API Referenceatlasatlas/units
Size2d
Width and height value with component-wise arithmetic returning new values.
Module: atlas/units
Width and height value with component-wise arithmetic returning new values.
Declaration
export class Size2d { ... }Constructors
constructor(width: number, height: number);Properties
width
width: number;height
height: number;Methods
zero
static zero(): Size2d;toString
toString(): string;add
Returns a new value by adding the operand component-wise; a numeric operand applies to every component.
add(other: Size2d | number): Size2d;subtract
Returns a new value by subtracting the operand component-wise; a numeric operand applies to every component.
subtract(other: Size2d | number): Size2d;multiply
Returns a new value by multiplying by the operand component-wise; a numeric operand applies to every component.
multiply(other: Size2d | number): Size2d;divide
Returns a new value by dividing by the operand component-wise; a numeric operand applies to every component.
divide(other: Size2d | number): Size2d;is
Tests exact equality of all components.
is(other: Size2d): boolean;