rect.js
No description.

File Location

/goog/math/rect.js

Classes

goog.math.Rect
Class for representing rectangular regions.

Public Protected Private

Global Functions

goog.math.Rect.boundingRect(ab) goog.math.Rect
Returns a new rectangle which completely contains both input rectangles.
Arguments:
a : goog.math.Rect
A rectangle.
b : goog.math.Rect
A rectangle.
Returns: goog.math.Rect  A new bounding rect, or null if either rect is null.
code »
goog.math.Rect.createFromBox(box) !goog.math.Rect
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:
box : goog.math.Box
A box.
Returns: !goog.math.Rect  A new Rect initialized with the box's position and size.
code »
goog.math.Rect.difference(ab) !Array.<!goog.math.Rect>
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:
a : goog.math.Rect
A Rectangle.
b : goog.math.Rect
A Rectangle.
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 »
goog.math.Rect.equals(ab) boolean
Compares rectangles for equality.
Arguments:
a : goog.math.Rect
A Rectangle.
b : goog.math.Rect
A Rectangle.
Returns: boolean  True iff the rectangles have the same left, top, width, and height, or if both are null.
code »
goog.math.Rect.intersection(ab) goog.math.Rect
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:
a : goog.math.Rect
A Rectangle.
b : goog.math.Rect
A Rectangle.
Returns: goog.math.Rect  A new intersection rect (even if width and height are 0), or null if there is no intersection.
code »
goog.math.Rect.intersects(ab) boolean
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:
a : goog.math.Rect
A Rectangle.
b : goog.math.Rect
A Rectangle.
Returns: boolean  Whether a and b intersect.
code »

Directory math

File Reference