Home

# Class goog.math.Size

Class for representing sizes consisting of a width and height. Undefined width and height support is deprecated and results in compiler warning.

Instance Method Summary
| `area() ⇒ number`
| `aspectRatio() ⇒ number`
| `ceil() ⇒ !goog.math.Size` Clamps the width and height parameters upward to integer values.
| `clone() ⇒ !goog.math.Size`
| `fitsInside(!goog.math.Size target) ⇒ boolean`
| `floor() ⇒ !goog.math.Size` Clamps the width and height parameters downward to integer values.
| `getLongest() ⇒ number`
| `getShortest() ⇒ number`
| `isEmpty() ⇒ boolean`
| `perimeter() ⇒ number`
| `round() ⇒ !goog.math.Size` Rounds the width and height parameters to integer values.
| `scale(number s) ⇒ !goog.math.Size` Scales the size uniformly by a factor.
| `scaleToFit(!goog.math.Size target) ⇒ !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.
| `toString() ⇒ string` Returns a nice string representing size.

Static Method Summary
| `equals(?goog.math.Size a, ?goog.math.Size b) ⇒ boolean` Compares sizes for equality.