API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

C

classSize

@codexo/exojs / math / stable

Mutable 2D size (width × height) value type. All arithmetic methods mutate in place and return `this` for chaining. When `height` is omitted from `set`, `add`, `subtract`, `scale`, or `divide` it defaults to the same value as `width` (uniform operation). `Size.temp` provides a shared scratch instance. `Size.zero` is a read-only sentinel.

4
props
9
methods
0
events
Import
import { Size } from '@codexo/exojs'

Mutable 2D size (width × height) value type. All arithmetic methods mutate in place and return `this` for chaining. When `height` is omitted from `set`, `add`, `subtract`, `scale`, or `divide` it defaults to the same value as `width` (uniform operation).

`Size.temp` provides a shared scratch instance. `Size.zero` is a read-only sentinel.

Constructors1
new(width: number, height: number): Size
Methods9
add(width: number, height: number): this
clone(): Size
A plain, detached copy. Declared as Size rather than this so ObservableSize can hand back a value that carries no callback - a clone is a value, not a second observer of the original's owner.
copy(size: { height: number; width: number }): this
destroy(): void
divide(width: number, height: number): this
equals(__namedParameters: Partial<Size>): boolean
scale(width: number, height: number): this
set(width: number, height: number): this
subtract(width: number, height: number): this
Properties4
zero: Size
height: number
width: number
temp: Size
Source