diff options
Diffstat (limited to 'native')
-rw-r--r-- | native/src/layout/limits.rs | 9 | ||||
-rw-r--r-- | native/src/widget/operation/focusable.rs | 4 |
2 files changed, 9 insertions, 4 deletions
diff --git a/native/src/layout/limits.rs b/native/src/layout/limits.rs index 33a452d0..0ddee91a 100644 --- a/native/src/layout/limits.rs +++ b/native/src/layout/limits.rs @@ -153,12 +153,17 @@ impl Limits { /// Computes the resulting [`Size`] that fits the [`Limits`] given the /// intrinsic size of some content. + #[allow(clippy::manual_clamp)] pub fn resolve(&self, intrinsic_size: Size) -> Size { Size::new( - intrinsic_size.width.clamp(self.fill.width, self.max.width), + intrinsic_size + .width + .min(self.max.width) + .max(self.fill.width), intrinsic_size .height - .clamp(self.fill.height, self.max.height), + .min(self.max.height) + .max(self.fill.height), ) } } diff --git a/native/src/widget/operation/focusable.rs b/native/src/widget/operation/focusable.rs index 0067006b..312e4894 100644 --- a/native/src/widget/operation/focusable.rs +++ b/native/src/widget/operation/focusable.rs @@ -18,10 +18,10 @@ pub trait Focusable { #[derive(Debug, Clone, Copy, PartialEq, Eq, Default)] pub struct Count { /// The index of the current focused widget, if any. - focused: Option<usize>, + pub focused: Option<usize>, /// The total amount of focusable widgets. - total: usize, + pub total: usize, } /// Produces an [`Operation`] that focuses the widget with the given [`Id`]. |