class jive.geom.IntRectangle
A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-left point (x, y) in the coordinate space, its width, and its height.
Class Fields
Instance Fields
function grow(h:Int, v:Int): Void
Resizes the Rectangle
both horizontally and vertically.
This method modifies the Rectangle
so that it is
h
units larger on both the left and right side,
and v
units larger at both the top and bottom.
The new Rectangle
has (x - h
,
y - v
) as its top-left corner, a
width of
width
+
2h
,
and a height of
height
+
2v
.
If negative values are supplied for h
and
v
, the size of the Rectangle
decreases accordingly.
The grow
method does not check whether the resulting
values of width
and height
are
non-negative.
h | the horizontal expansion |
v | the vertical expansion |
function setRectXYWH(x:Int, y:Int, width:Int, height:Int): Void
Sets the rect with x, y, width and height.
function setWithRectangle(r:Rectangle): Void
Sets the location with a Point
, the value will be transfer to int.
p | the location to be set. |
function union(r:IntRectangle): IntRectangle
Computes the union of this Rectangle
with the
specified Rectangle
. Returns a new
Rectangle
that
represents the union of the two rectangles
r | the specified |
returns | the smallest |