Skip to main content

Module box_model

Module box_model 

Source
Expand description

Box-model helpers for padding, margins, insets, and aspect ratios.

Enums§

ShrinkAxis
Axes affected when shrinking a box by its padding or margin.

Functions§

apply_aspect_ratio
Derives the auto-sized axis from the other axis using ratio.
inset_rect
Insets a rectangle by padding, clamping the resulting size to zero.
shrink_by_margin
Returns the content size after subtracting margin from both axes.
shrink_by_padding
Returns the content size after subtracting padding from both axes.