iris: separate layout allocation from lengths

This commit is contained in:
iris committed 2026-09-12 19:35:18 -04:00
1 parent 2b9d8c49a0
commit 1f15125992
17 files changed
+395 -168

No files matched your search

+4 -4
View File
@@ -2,12 +2,12 @@ use crate::prelude::*;
pub struct MaxSize {
pub inner: StrongWidget,
pub x: Option<Len>,
pub y: Option<Len>,
pub x: Option<LayoutLen>,
pub y: Option<LayoutLen>,
}
impl MaxSize {
fn clamp(len: Len, max: Option<Len>, output: f32, density: f32) -> Len {
fn clamp(len: LayoutLen, max: Option<LayoutLen>, output: f32, density: f32) -> LayoutLen {
let Some(max) = max else {
return len;
};
@@ -20,7 +20,7 @@ impl MaxSize {
}
}
fn clamp_region(offered_px: f32, max: Option<Len>, output: f32, density: f32) -> UiSpan {
fn clamp_region(offered_px: f32, max: Option<LayoutLen>, output: f32, density: f32) -> UiSpan {
let Some(max) = max else {
return UiSpan::FULL;
};