Class: Size
Defined in: packages/blockly/core/utils/size.ts:19
Class for representing sizes consisting of a width and height.
Properties index
| Property | Description |
|---|---|
| width | Width. |
| height | Height. |
Methods index
| Method | Description |
|---|---|
| equals | Compares sizes for equality. |
| max | Returns a new size with the maximum width and height values out of both sizes. |
| min | Returns 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
| Parameter | Type | Description |
|---|---|---|
width | number | Width. |
height | number | Height. |
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
| Parameter | Type | Description |
|---|---|---|
a? | Size | null | A Size. |
b? | Size | null | A 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
| Parameter | Type |
|---|---|
a | Size |
b | Size |
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
| Parameter | Type |
|---|---|
a | Size |
b | Size |
Returns
Size