Add the math for pane resizing

This commit is contained in:
Mikayla Maki
2023-07-12 22:35:51 -07:00
parent 5385ca411b
commit 26b9be628e
5 changed files with 103 additions and 41 deletions
+13
View File
@@ -1268,6 +1268,19 @@ impl Vector2FExt for Vector2F {
}
}
pub trait RectFExt {
fn length_along(self, axis: Axis) -> f32;
}
impl RectFExt for RectF {
fn length_along(self, axis: Axis) -> f32 {
match axis {
Axis::Horizontal => self.width(),
Axis::Vertical => self.height(),
}
}
}
#[derive(Copy, Clone, Debug)]
pub struct SizeConstraint {
pub min: Vector2F,