Constructors
- Parameters:
- width: Number — optional
- height: Number — optional
- Returns:
- Size
Creates a Size object with the given value for both width and height.
- Parameters:
- size: Number — The width and height of the Size
- Returns:
- Size
Operators
Returns the addition of the width and height of the supplied size to the size as a new size. The object itself is not modified!
Sample code:
var firstSize = new Size(8, 10); var secondSize = new Size(2, 5); var result = firstSize + secondSize; print(result); // { width: 10.0, height: 15.0 }
- Returns:
- Size
Returns the addition of the supplied value to the width and height of the size as a new size. The object itself is not modified!
Sample code:
var point = new Size(10, 20); var result = size + 5; print(result); // { width: 15.0, height: 25.0 }
- Returns:
- Size — the addition of the size and the value as a new size
Returns the subtraction of the width and height of the supplied size from the size as a new size. The object itself is not modified!
Sample code:
var firstSize = new Size(8, 10); var secondSize = new Size(2, 5); var result = firstSize - secondSize; print(result); // { width: 6.0, height: 5.0 }
- Returns:
- Size
Returns the subtraction of the supplied value from the width and height of the size as a new size. The object itself is not modified!
Sample code:
var point = new Size(10, 20); var result = size - 5; print(result); // { width: 5.0, height: 15.0 }
- Returns:
- Size — the subtraction of the value from the size as a new size
Returns the multiplication of the width and height of the supplied size with the size as a new size. The object itself is not modified!
Sample code:
var firstSize = new Size(8, 10); var secondSize = new Size(2, 5); var result = firstSize * secondSize; print(result); // { width: 16.0, height: 50.0 }
- Returns:
- Size
Returns the multiplication of the supplied value with the width and height of the size as a new size. The object itself is not modified!
Sample code:
var point = new Size(10, 20); var result = size * 2; print(result); // { width: 20.0, height: 40.0 }
- Returns:
- Size — the multiplication of the size by the value as a new size
Returns the division of the width and height of the supplied size by the size as a new size. The object itself is not modified!
Sample code:
var firstSize = new Size(8, 10); var secondSize = new Size(2, 5); var result = firstSize / secondSize; print(result); // { width: 4.0, height: 2.0 }
- Returns:
- Size
Returns the division of the supplied value by the width and height of the size as a new size. The object itself is not modified!
Sample code:
var point = new Size(10, 20); var result = size / 2; print(result); // { width: 5.0, height: 10.0 }
- Returns:
- Size — the division of the size by the value as a new size
The modulo operator returns the integer remainders of dividing the size by the supplied size as a new size.
Sample code:
var size = new Size(12, 6); print(size % new Size(5, 2)); // {width: 2, height: 0}
- Returns:
- Size — the integer remainders of dividing the sizes by each other as a new size
The modulo operator returns the integer remainders of dividing the size by the supplied value as a new size.
Sample code:
var size = new Size(12, 6); print(size % 5); // {width: 2, height: 1}
- Returns:
- Size — the integer remainders of dividing the size by the value as a new size