goog.math.Size
Classgoog.math.Size(width, height)
Class for representing sizes consisting of a width and height. Undefined width and height support is deprecated and results in compiler warning.
width
{number
}
height
{number
}
.area()
number
}
.aspectRatio()
number
}
.ceil()
Clamps the width and height parameters upward to integer values.
goog.math.Size
}
.clone()
goog.math.Size
}
.equals(a, b)
Compares sizes for equality.
a
{goog.math.Size
}
b
{goog.math.Size
}
boolean
}
.fitsInside(target)
target
{!goog.math.Size
}
boolean
}
.floor()
Clamps the width and height parameters downward to integer values.
goog.math.Size
}
.getLongest()
number
}
.getShortest()
number
}
.height
{number
}Height
.isEmpty()
boolean
}
.perimeter()
number
}
.round()
Rounds the width and height parameters to integer values.
goog.math.Size
}
.scale(s)
Scales the size uniformly by a factor.
s
{number
}
goog.math.Size
}
.scaleToFit(target)
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.
target
{!goog.math.Size
}
goog.math.Size
}
.toString()
Returns a nice string representing size.
string
}
.width
{number
}Width