Protected_heightProtected_widthStatic ReadonlyzeroA Size2 with all components set to zero.
The height.
Determines if width and height are zero.
The width.
StaticaddStaticdivideStaticdivideStaticisStaticisStaticmaxStaticminStaticmultiplyStaticmultiplyStaticsubtract
The Size2 implements a 2D size with a width and height. The class follows the 'copy-on-write' pattern, which means that every operation such as Size2.add or Size2.subtract returns a copy of the size2 with updates values. It also implies that the values of the size2 cannot be directly modified.
The concept of immutability improves sharing of objects as all types in TypeScript are assigned by identity, instead of by-value (e.g. a copy) as in other programming languages like C.