Box class

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.

This class assumes 'screen coordinates': larger Y coordinates are further from the top of the screen.

@param {number} top Top. @param {number} right Right. @param {number} bottom Bottom. @param {number} left Left. @struct @constructor

Implemented types

Constructors

Box([double top = 0.0, double right = 0.0, double bottom = 0.0, double left = 0.0])
Box.fromSymmetric(double side)
factory

Properties

bottom double
getter/setter pair
hashCode int
The hash code for this object.
no setteroverride
left double
getter/setter pair
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
top double
getter/setter pair

Methods

clamp(Box maxBox, Box minBox) Box
@param maxBox -- Beginning of range @param minBox -- End of range
copy() Box
Clone this object.
getBoxDimension(CardinalDirection cardinalDirection) BoxDimension
Get value accessor for dimension.
getHeight() double
@return {double} height The height of this Box.
getPercentOfSize(Size size) Box
getWidth() double
@return {double} width The width of this Box.
marshal(MarshalledObject marshalled) → void
Marshal method must operate by mutating empty object passed.
override
max(Box maxBox) Box
min(Box minBox) Box
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
scale(double sx, double sy) → void
Scales this size by the given scale factors. The width and height are scaled by {@code sx} and {@code opt_sy} respectively. If {@code opt_sy} is not given, then {@code sx} is used for both the width and height. @param {number} sx The scale factor to use for the width. @param {number=} opt_sy The scale factor to use for the height. @return {!goog.math.Size} This Size object after scaling.
sum(Axis axis) double
Get sum of values on axis.
sumOfAllSides() double
Get sum of all sides
toRect(Size size) Rect
Generate a Rect from this box, out of given Size (Size is what Rect is out of).
toString() String
Returns a nice string representing the box. @return {string} In the form (50t, 73r, 24b, 13l). @override
override

Operators

operator ==(Object other) bool
The equality operator.
override

Static Properties

ZERO_BOX Box
getter/setter pair

Static Methods

unmarshal(MarshalledObject marshalled) Box
Encoded object parameter is encoded depending on format.