A sizer object for use with the box engine layout functions.

Notes

A box sizer holds the geometry information for an object along an arbitrary layout orientation.

For best performance, this class should be treated as a raw data struct. It should not typically be subclassed.

Constructors

Properties

done: boolean = false

An internal storage property for the layout algorithm.

Notes

This value is used as temporary storage by the layout algorithm.

Changing this value will have no effect.

maxSize: number = Infinity

The maximum size of the sizer.

Notes

The sizer will never be sized greater than this value, even if it means the sizer will underflow the available layout space.

It is assumed that this value lies in the range [0, Infinity] and that it is >= to minSize. Failure to adhere to this constraint will yield undefined results.

The default value is Infinity.

minSize: number = 0

The minimum size of the sizer.

Notes

The sizer will never be sized less than this value, even if it means the sizer will overflow the available layout space.

It is assumed that this value lies in the range [0, Infinity) and that it is <= to maxSize. Failure to adhere to this constraint will yield undefined results.

The default value is 0.

size: number = 0

The computed size of the sizer.

Notes

This value is the output of a call to BoxEngine.calc. It represents the computed size for the object along the layout orientation, and will always lie in the range [minSize, maxSize].

This value is output only.

Changing this value will have no effect.

sizeHint: number = 0

The preferred size for the sizer.

Notes

The sizer will be given this initial size subject to its size bounds. The sizer will not deviate from this size unless such deviation is required to fit into the available layout space.

There is no limit to this value, but it will be clamped to the bounds defined by minSize and maxSize.

The default value is 0.

stretch: number = 1

The stretch factor for the sizer.

Notes

This controls how much the sizer stretches relative to its sibling sizers when layout space is distributed. A stretch factor of zero is special and will cause the sizer to only be resized after all other sizers with a stretch factor greater than zero have been resized to their limits.

It is assumed that this value is an integer that lies in the range [0, Infinity). Failure to adhere to this constraint will yield undefined results.

The default value is 1.