Class for representing rectangular regions.
| Instance Method Summary | |
boundingRect(?goog.math.Rect rect)Expand this rectangle to also include the area of the given rectangle. | |
clone() ⇒ !goog.math.RectReturns a new copy of the rectangle. | |
contains((goog.math.Coordinate|goog.math.Rect|null) another) ⇒ booleanTests whether this rectangle entirely contains another rectangle or coordinate. | |
difference(?goog.math.Rect rect) ⇒ !ArrayComputes the difference regions between this rectangle and {@code 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. | |
getSize() ⇒ !goog.math.SizeReturns the size of this rectangle. | |
intersection(?goog.math.Rect rect) ⇒ booleanComputes the intersection of this rectangle and the rectangle parameter. If there is no intersection, returns false and leaves this rectangle as is. | |
intersects(?goog.math.Rect rect) ⇒ booleanReturns whether a rectangle intersects this rectangle. | |
toBox() ⇒ !goog.math.BoxReturns a new Box object with the same position and dimensions as this rectangle. | |
toString() ⇒ stringReturns a nice string representing size and dimensions of rectangle. | |
| Static Method Summary | |
boundingRect(?goog.math.Rect a, ?goog.math.Rect b) ⇒ ?goog.math.RectReturns a new rectangle which completely contains both input rectangles. | |
createFromBox(?goog.math.Box box) ⇒ !goog.math.RectCreates 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. | |
difference(?goog.math.Rect a, ?goog.math.Rect b) ⇒ !ArrayComputes 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. | |
equals(?goog.math.Rect a, ?goog.math.Rect b) ⇒ booleanCompares rectangles for equality. | |
intersection(?goog.math.Rect a, ?goog.math.Rect b) ⇒ ?goog.math.RectReturns 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. | |
intersects(?goog.math.Rect a, ?goog.math.Rect b) ⇒ booleanReturns 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. | |