BoxInterface
interface BoxInterface
Interface for a box.
Methods
Gets box height.
Gets box width.
Creates new BoxInterface instance with ratios applied to both sides.
Creates new BoxInterface, adding given size to both sides.
Checks whether current box can fit given box at a given start position, start position defaults to top left corner xy(0,0).
Gets current box square, useful for getting total number of pixels in a given box.
Returns a string representation of the current box.
Resizes box to given width, constraining proportions and returns the new box.
Resizes box to given height, constraining proportions and returns the new box.
Details
at line 24
int
getHeight()
Gets box height.
at line 31
int
getWidth()
Gets box width.
at line 40
BoxInterface
scale(float $ratio)
Creates new BoxInterface instance with ratios applied to both sides.
at line 49
BoxInterface
increase(int $size)
Creates new BoxInterface, adding given size to both sides.
at line 60
bool
contains(BoxInterface $box, PointInterface $start = null)
Checks whether current box can fit given box at a given start position, start position defaults to top left corner xy(0,0).
at line 68
int
square()
Gets current box square, useful for getting total number of pixels in a given box.
at line 75
string
__toString()
Returns a string representation of the current box.
at line 84
BoxInterface
widen(int $width)
Resizes box to given width, constraining proportions and returns the new box.
at line 93
BoxInterface
heighten(int $height)
Resizes box to given height, constraining proportions and returns the new box.