Class: Size2

Size2(width, height)

A size that has a width and a height.

Constructor

new Size2(width, height)

Creates a new Size2.
Parameters:
Name Type Default Description
width Number 0 The width of the size.
height Number 0 The height of the size.
Source:

Methods

aspectRatio() → {Number}

Calculates the aspect ratio of the size (its width divided by its height).
Source:
Returns:
The aspect ratio of the size.
Type
Number

clone() → {Size2}

Creates a clone of the size.
Source:
Returns:
The cloned size.
Type
Size2

copy(size) → {Size2}

Copies the width and the height of another size.
Parameters:
Name Type Description
size Size2 The size to copy.
Source:
Returns:
The size.
Type
Size2

equals(size) → {Boolean}

Compares the properties to another size.
Parameters:
Name Type Description
size Size2 The size to compare to.
Source:
Returns:
A value indicating whether the properties of the sizes are equal.
Type
Boolean

set(width, height) → {Size2}

Sets the width and the height of the size.
Parameters:
Name Type Description
width Number The width to set.
height Number The height to set.
Source:
Returns:
The size.
Type
Size2