summaryrefslogtreecommitdiffstats
path: root/native/src/widget/pane_grid/axis.rs
diff options
context:
space:
mode:
Diffstat (limited to 'native/src/widget/pane_grid/axis.rs')
-rw-r--r--native/src/widget/pane_grid/axis.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/native/src/widget/pane_grid/axis.rs b/native/src/widget/pane_grid/axis.rs
index b3a306d5..2320cb7c 100644
--- a/native/src/widget/pane_grid/axis.rs
+++ b/native/src/widget/pane_grid/axis.rs
@@ -53,6 +53,30 @@ impl Axis {
}
}
}
+
+ pub(super) fn split_line_bounds(
+ &self,
+ rectangle: Rectangle,
+ ratio: f32,
+ spacing: f32,
+ ) -> Rectangle {
+ match self {
+ Axis::Horizontal => Rectangle {
+ x: rectangle.x,
+ y: (rectangle.y + rectangle.height * ratio - spacing / 2.0)
+ .round(),
+ width: rectangle.width,
+ height: spacing,
+ },
+ Axis::Vertical => Rectangle {
+ x: (rectangle.x + rectangle.width * ratio - spacing / 2.0)
+ .round(),
+ y: rectangle.y,
+ width: spacing,
+ height: rectangle.height,
+ },
+ }
+ }
}
#[cfg(test)]