struct GUIConstrainedSizeRange

Contains valid size range for a GUI element, based on element's optimal size and size constraints.

Public

Methods

CalculateSizeConstrainedByParentSize

GUILogicalSize CalculateSizeConstrainedByParentSize(const GUISizeConstraints &sizeConstraints, const GUILogicalSize &parentSize) const

Calculates GUI element size constrained by parent size.

For example, if a GUI element optimal width is 100 units, but parent is only 50 units wide, then the optimal size may be reduced to 50 units, if the constraints permit it.

sizeConstraints
Size constrains this size range was originally created with. New size will respect these constraints (e.g. if width is fixed, parent width will have no impact).
parentSize
Size of the parent element to constrain the current size within.

Fields

Optimal

GUILogicalSize Optimal

Optimal GUI element size, constrained by the size constraints.

Minimum

GUILogicalSize Minimum

In case of flexible size, minimum allowed size.

Equivalent to Optimal if size is fixed.

Maximum

GUILogicalSize Maximum

In case of flexible size, maximum allowed size.

Equivalent to Optimal if size is fixed. If 0, the dimension has no maximum limit.