goog.math.Rect |
x
: number
Left.
|
y
: number
Top.
|
w
: number
Width.
|
h
: number
Height.
|
![]()
Expand this rectangle to also include the area of the given rectangle.
Arguments:
|
code » | |||
Rounds the fields to the next larger integer values.
Returns: !goog.math.Rect
This rectangle with ceil'd fields.
|
code » | |||
No description.
Returns: !goog.math.Rect
A new copy of this Rectangle.
|
code » | |||
Tests whether this rectangle entirely contains another rectangle or
coordinate.
Arguments:
Returns: boolean
Whether this rectangle contains given rectangle or
coordinate.
|
code » | |||
Computes the difference regions between this rectangle and
rect . The
return value is an array of 0 to 4 rectangles defining the remaining regions
of this rectangle after the other has been subtracted.
Arguments:
Returns: !Array.<!goog.math.Rect>
An array with 0 to 4 rectangles which
together define the difference area of rectangle a minus rectangle b.
|
code » | |||
No description.
Arguments:
Returns: number
The distance between the point and the closest point
inside the rectangle. Returns 0 if the point is inside the rectangle.
|
code » | |||
Rounds the fields to the next smaller integer values.
Returns: !goog.math.Rect
This rectangle with floored fields.
|
code » | |||
No description.
Returns: !goog.math.Coordinate
A new coordinate for the bottom-right corner
of the rectangle.
|
code » | |||
No description.
Returns: !goog.math.Coordinate
A new coordinate for the center of the
rectangle.
|
code » | |||
No description.
Returns: !goog.math.Size
The size of this rectangle.
|
code » | |||
No description.
Returns: !goog.math.Coordinate
A new coordinate for the top-left corner of
the rectangle.
|
code » | |||
Computes the intersection of this rectangle and the rectangle parameter. If
there is no intersection, returns false and leaves this rectangle as is.
Arguments:
Returns: boolean
True iff this rectangle intersects with the parameter.
|
code » | |||
Returns whether a rectangle intersects this rectangle.
Arguments:
Returns: boolean
Whether rect intersects this rectangle.
|
code » | |||
Rounds the fields to nearest integer values.
Returns: !goog.math.Rect
This rectangle with rounded fields.
|
code » | |||
Scales this rectangle by the given scale factors. The left and width values
are scaled by
sx and the top and height values are scaled by
opt_sy . If opt_sy is not given, then all fields are scaled
by sx .
Arguments:
Returns: !goog.math.Rect
This rectangle after scaling.
|
code » | |||
No description.
Arguments:
Returns: number
The squared distance between the point and the closest
point inside the rectangle. Returns 0 if the point is inside the
rectangle.
|
code » | |||
Returns a new Box object with the same position and dimensions as this
rectangle.
Returns: !goog.math.Box
A new Box representation of this Rectangle.
|
code » | |||
Returns a nice string representing size and dimensions of rectangle.
Returns: string
In the form (50, 73 - 75w x 25h).
|
code » | |||
Translates this rectangle by the given offsets. If a
goog.math.Coordinate is given, then the left and top values are
translated by the coordinate's x and y values. Otherwise, top and left are
translated by tx and opt_ty respectively.
Arguments:
Returns: !goog.math.Rect
This rectangle after translating.
|
code » |
Returns a new rectangle which completely contains both input rectangles.
Arguments:
Returns: goog.math.Rect
A new bounding rect, or null if either rect is
null.
|
code » | |||
Creates a new Rect object with the same position and dimensions as a given
Box. Note that this is only the inverse of toBox if left/top are defined.
Arguments:
Returns: !goog.math.Rect
A new Rect initialized with the box's position
and size.
|
code » | |||
Computes the difference regions between two rectangles. The return value is
an array of 0 to 4 rectangles defining the remaining regions of the first
rectangle after the second has been subtracted.
Arguments:
Returns: !Array.<!goog.math.Rect>
An array with 0 to 4 rectangles which
together define the difference area of rectangle a minus rectangle b.
|
code » | |||
Compares rectangles for equality.
Arguments:
Returns: boolean
True iff the rectangles have the same left, top, width,
and height, or if both are null.
|
code » | |||
Returns the intersection of two rectangles. Two rectangles intersect if they
touch at all, for example, two zero width and height rectangles would
intersect if they had the same top and left.
Arguments:
Returns: goog.math.Rect
A new intersection rect (even if width and height
are 0), or null if there is no intersection.
|
code » | |||
Returns whether two rectangles intersect. Two rectangles intersect if they
touch at all, for example, two zero width and height rectangles would
intersect if they had the same top and left.
Arguments:
Returns: boolean
Whether a and b intersect.
|
code » |