/
Box.html
6 lines (6 loc) · 3.87 KB
/
Box.html
1
2
3
4
5
6
<!doctype html><html><head><title>goog.math.Box</title><link href="../../stylesheet.css" rel="stylesheet" type="text/css"></head><body><a href="../../index.html">Home</a><h1>Class goog.math.Box</h1><p>Class for representing a box. A box is specified as a top, right, bottom,
and left. A box is useful for representing margins and padding.</p><table class="method-list"><tr><td colspan="2"><strong>Instance Method Summary</strong></td></tr><tr><td class="method-list-cell method-access method-public"></td><td class="method-list-cell method-cell"><code>clone() ⇒ !goog.math.Box</code><br><p class="method-description">Creates a copy of the box with the same dimensions.</p></td></tr><tr><td class="method-list-cell method-access method-public"></td><td class="method-list-cell method-cell"><code>contains((goog.math.Box|goog.math.Coordinate|null) other) ⇒ boolean</code><br><p class="method-description">Returns whether the box contains a coordinate or another box.</p></td></tr><tr><td class="method-list-cell method-access method-public"></td><td class="method-list-cell method-cell"><code>expand((goog.math.Box|null|number) top, number= opt_right, number= opt_bottom, number= opt_left) ⇒ !goog.math.Box</code><br><p class="method-description">Expands box with the given margins.</p></td></tr><tr><td class="method-list-cell method-access method-public"></td><td class="method-list-cell method-cell"><code>expandToInclude(?goog.math.Box box)</code><br><p class="method-description">Expand this box to include another box.
NOTE(user): This is used in code that needs to be very fast, please don't
add functionality to this function at the expense of speed (variable
arguments, accepting multiple argument types, etc).</p></td></tr><tr><td class="method-list-cell method-access method-public"></td><td class="method-list-cell method-cell"><code>toString() ⇒ string</code><br><p class="method-description">Returns a nice string representing the box.</p></td></tr></table><table class="method-list"><tr><td colspan="2"><strong>Static Method Summary</strong></td></tr><tr><td class="method-list-cell method-access method-public"></td><td class="method-list-cell method-cell"><code>boundingBox((goog.math.Coordinate|null|undefined) var_args) ⇒ !goog.math.Box</code><br><p class="method-description">Creates a Box by bounding a collection of goog.math.Coordinate objects</p></td></tr><tr><td class="method-list-cell method-access method-public"></td><td class="method-list-cell method-cell"><code>contains(?goog.math.Box box, (goog.math.Box|goog.math.Coordinate|null) other) ⇒ boolean</code><br><p class="method-description">Returns whether a box contains a coordinate or another box.</p></td></tr><tr><td class="method-list-cell method-access method-public"></td><td class="method-list-cell method-cell"><code>distance(?goog.math.Box box, ?goog.math.Coordinate coord) ⇒ number</code><br><p class="method-description">Returns the distance between a coordinate and the nearest corner/side of a
box. Returns zero if the coordinate is inside the box.</p></td></tr><tr><td class="method-list-cell method-access method-public"></td><td class="method-list-cell method-cell"><code>equals(?goog.math.Box a, ?goog.math.Box b) ⇒ boolean</code><br><p class="method-description">Compares boxes for equality.</p></td></tr><tr><td class="method-list-cell method-access method-public"></td><td class="method-list-cell method-cell"><code>intersects(?goog.math.Box a, ?goog.math.Box b) ⇒ boolean</code><br><p class="method-description">Returns whether two boxes intersect.</p></td></tr><tr><td class="method-list-cell method-access method-public"></td><td class="method-list-cell method-cell"><code>intersectsWithPadding(?goog.math.Box a, ?goog.math.Box b, number padding) ⇒ boolean</code><br><p class="method-description">Returns whether two boxes would intersect with additional padding.</p></td></tr></table></body></html>