← Standard library

BoxConstraints

struct BoxConstraints
import BoxConstraints from Wax;

Minimum and maximum layout dimensions in logical points. Supply ordered bounds on both axes; construction does not validate them. Use Constrain to clamp a desired size into the box.

Layout.wax:56

Members

minWidthfield

public float minWidth

Inclusive minimum width.

Layout.wax:60

maxWidthfield

public float maxWidth

Inclusive maximum width.

Layout.wax:64

minHeightfield

public float minHeight

Inclusive minimum height.

Layout.wax:68

maxHeightfield

public float maxHeight

Inclusive maximum height.

Layout.wax:72

constructorconstructor

public constructor (float minWidth, float maxWidth, float minHeight, float maxHeight)

Stores all four bounds without validation.

Layout.wax:77

Tightmethod

public static fn Tight(Size size) : BoxConstraints

Requires exactly the supplied size by setting equal minimum and maximum bounds.

Layout.wax:87

Loosemethod

public static fn Loose(Size size) : BoxConstraints

Allows dimensions from zero up to the supplied size.

Layout.wax:94

Biggestmethod

public fn Biggest() : Size

Returns the maximum width and height.

Layout.wax:101

Smallestmethod

public fn Smallest() : Size

Returns the minimum width and height.

Layout.wax:108

Constrainmethod

public fn Constrain(Size size) : Size

Clamps width and height independently to their inclusive bounds. Supply ordered bounds; NaN dimensions remain NaN.

Layout.wax:118

ToStringmethod

public fn ToString() : string

Provided by the compiler.

ToStringBuffermethod

public fn ToStringBuffer(StringBuilder builder) : int32

Provided by the compiler.