goog.math.Rect
Classgoog.math.Rect(x, y, w, h)
Class for representing rectangular regions.
x
{number
}
y
{number
}
w
{number
}
h
{number
}
.boundingRect(rect)
Expand this rectangle to also include the area of the given rectangle.
rect
{goog.math.Rect
}
.clone()
Returns a new copy of the rectangle.
goog.math.Rect
}
.contains(another)
Tests whether this rectangle entirely contains another rectangle or coordinate.
another
{goog.math.Rect
|goog.math.Coordinate
}
boolean
}
.createFromBox(box)
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.
box
{goog.math.Box
}
goog.math.Rect
}
.difference(a, b)
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.
a
{goog.math.Rect
}
b
{goog.math.Rect
}
Array
.<!goog.math.Rect
>}
.equals(a, b)
Compares rectangles for equality.
a
{goog.math.Rect
}
b
{goog.math.Rect
}
boolean
}
.getSize()
Returns the size of this rectangle.
goog.math.Size
}
.height
{number
}Height
.intersection(rect)
Computes the intersection of this rectangle and the rectangle parameter. If there is no intersection, returns false and leaves this rectangle as is.
rect
{goog.math.Rect
}
boolean
}
.intersects(a, b)
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.
a
{goog.math.Rect
}
b
{goog.math.Rect
}
boolean
}
.left
{number
}Left
.toBox()
Returns a new Box object with the same position and dimensions as this rectangle.
goog.math.Box
}
.toString()
Returns a nice string representing size and dimensions of rectangle.
string
}
.top
{number
}Top
.width
{number
}Width