Creates a Size object with the given value for both width and height.
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 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 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 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 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 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 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 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 }
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}
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}
Copyright © 2001-2011 Jürg Lehni, Scratchdisk.com. All Rights Reserved.