Skip to main content

Class: Size

Defined in: packages/blockly/core/utils/size.ts:19

Class for representing sizes consisting of a width and height.

Properties index

PropertyDescription
widthWidth.
heightHeight.

Methods index

MethodDescription
equalsCompares sizes for equality.
maxReturns a new size with the maximum width and height values out of both sizes.
minReturns a new size with the minimum width and height values out of both sizes.

Constructors

Constructor

new Size(width, height): Size;

Defined in: packages/blockly/core/utils/size.ts:24

Parameters

ParameterTypeDescription
widthnumberWidth.
heightnumberHeight.

Returns

Size

Properties

width

width: number;

Defined in: packages/blockly/core/utils/size.ts:25

Width.


height

height: number;

Defined in: packages/blockly/core/utils/size.ts:26

Height.

Methods

equals()

static equals(a?, b?): boolean;

Defined in: packages/blockly/core/utils/size.ts:37

Compares sizes for equality.

Parameters

ParameterTypeDescription
a?Size | nullA Size.
b?Size | nullA Size.

Returns

boolean

True iff the sizes have equal widths and equal heights, or if both are null.


max()

static max(a, b): Size;

Defined in: packages/blockly/core/utils/size.ts:51

Returns a new size with the maximum width and height values out of both sizes.

Parameters

ParameterType
aSize
bSize

Returns

Size


min()

static min(a, b): Size;

Defined in: packages/blockly/core/utils/size.ts:59

Returns a new size with the minimum width and height values out of both sizes.

Parameters

ParameterType
aSize
bSize

Returns

Size