goog.math.Size
Instance Methods
this.area() → number
number
Parameters | None. | ||
---|---|---|---|
Returns |
|
this.aspectRatio() → number
number
Parameters | None. | ||
---|---|---|---|
Returns |
|
this.ceil() → goog.math.Size
goog.math.Size
Clamps the width and height parameters upward to integer values.
Parameters | None. | ||
---|---|---|---|
Returns |
|
this.clone() → goog.math.Size
goog.math.Size
Parameters | None. | ||
---|---|---|---|
Returns |
|
this.fitsInside( target ) → boolean
boolean
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|
this.floor() → goog.math.Size
goog.math.Size
Clamps the width and height parameters downward to integer values.
Parameters | None. | ||
---|---|---|---|
Returns |
|
this.getLongest() → number
number
Parameters | None. | ||
---|---|---|---|
Returns |
|
this.getShortest() → number
number
Parameters | None. | ||
---|---|---|---|
Returns |
|
this.isEmpty() → boolean
boolean
Parameters | None. | ||
---|---|---|---|
Returns |
|
this.perimeter() → number
number
Parameters | None. | ||
---|---|---|---|
Returns |
|
this.round() → goog.math.Size
goog.math.Size
Rounds the width and height parameters to integer values.
Parameters | None. | ||
---|---|---|---|
Returns |
|
this.scale( sx, opt_sy ) → goog.math.Size
goog.math.Size
Scales this size by the given scale factors. The width and height are scaled
by sx
and opt_sy
respectively. If opt_sy
is not
given, then sx
is used for both the width and height.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
this.scaleToCover( target ) → goog.math.Size
goog.math.Size
Uniformly scales the size to perfectly cover the dimensions of a given size. If the size is already larger than the target, it will be scaled down to the minimum size at which it still covers the entire target. The original aspect ratio will be preserved.
This function assumes that both Sizes contain strictly positive dimensions.
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|
this.scaleToFit( target ) → goog.math.Size
goog.math.Size
Uniformly scales the size to fit inside the dimensions of a given size. The original aspect ratio will be preserved.
This function assumes that both Sizes contain strictly positive dimensions.
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|
this.toString() → string
string
Returns a nice string representing size.
Parameters | None. | ||
---|---|---|---|
Returns |
|
Instance Properties
this.height → number
number
Height
this.width → number
number
Width
Static Functions
Size.equals( a, b ) → boolean
boolean
Compares sizes for equality.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|