Function apply_layout_size

Source
pub fn apply_layout_size(
    intrinsic: Size,
    layout: LayoutStyle,
    constraints: Constraints,
) -> Size
Expand description

Resolves declarative sizing and constraints around an intrinsic size.

All sizes are logical pixels. Resolution, min/max precedence, and non-finite handling are delegated to [ailloli_ui_core::style::resolve_widget_size].

ยงExamples

use ailloli_ui_core::{Constraints, Size};
use ailloli_ui_core::style::LayoutStyle;
use ailloli_ui_widgets::layout::layout_ext::apply_layout_size;
let size = apply_layout_size(Size::new(10.0, 20.0), LayoutStyle::new().width(40.0), Constraints::loose(100.0, 100.0));
assert_eq!(size, Size::new(40.0, 20.0));