iris: separate layout allocation from lengths
This commit is contained in:
1 parent
2b9d8c49a0
commit
1f15125992
17 files changed
+395
-168
No files matched your search
@@ -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;
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user