box.js
No description.

File Location

/goog/math/box.js

Classes

goog.math.Box
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.

Public Protected Private

Global Functions

goog.math.Box.boundingBox(var_args) !goog.math.Box
Creates a Box by bounding a collection of goog.math.Coordinate objects
Arguments:
var_args : ...goog.math.Coordinate
Coordinates to be included inside the box.
Returns: !goog.math.Box  A Box containing all the specified Coordinates.
code »
goog.math.Box.contains(boxother) boolean
Returns whether a box contains a coordinate or another box.
Arguments:
box : goog.math.Box
A Box.
other : goog.math.Coordinate | goog.math.Box
A Coordinate or a Box.
Returns: boolean  Whether the box contains the coordinate or other box.
code »
goog.math.Box.distance(boxcoord) number
Returns the distance between a coordinate and the nearest corner/side of a box. Returns zero if the coordinate is inside the box.
Arguments:
box : goog.math.Box
A Box.
coord : goog.math.Coordinate
A Coordinate.
Returns: number  The distance between coord and the nearest corner/side of box, or zero if coord is inside box.
code »
goog.math.Box.equals(ab) boolean
Compares boxes for equality.
Arguments:
a : goog.math.Box
A Box.
b : goog.math.Box
A Box.
Returns: boolean  True iff the boxes are equal, or if both are null.
code »
goog.math.Box.intersects(ab) boolean
Returns whether two boxes intersect.
Arguments:
a : goog.math.Box
A Box.
b : goog.math.Box
A second Box.
Returns: boolean  Whether the boxes intersect.
code »
goog.math.Box.intersectsWithPadding(abpadding) boolean
Returns whether two boxes would intersect with additional padding.
Arguments:
a : goog.math.Box
A Box.
b : goog.math.Box
A second Box.
padding : number
The additional padding.
Returns: boolean  Whether the boxes intersect.
code »
goog.math.Box.relativePositionX(boxcoord) number
Returns the relative x position of a coordinate compared to a box. Returns zero if the coordinate is inside the box.
Arguments:
box : goog.math.Box
A Box.
coord : goog.math.Coordinate
A Coordinate.
Returns: number  The x position of coord relative to the nearest side of box, or zero if coord is inside box.
code »
goog.math.Box.relativePositionY(boxcoord) number
Returns the relative y position of a coordinate compared to a box. Returns zero if the coordinate is inside the box.
Arguments:
box : goog.math.Box
A Box.
coord : goog.math.Coordinate
A Coordinate.
Returns: number  The y position of coord relative to the nearest side of box, or zero if coord is inside box.
code »

Directory math

File Reference