summaryrefslogtreecommitdiffstats
path: root/native/src/widget/pane_grid
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-06-08 18:33:36 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-06-08 18:33:36 +0200
commit8493ccec7fd4639aef9e02ad3519a7a3707cd488 (patch)
tree528fc7245a21fc5f362cca2bec609e8e9aaed4fb /native/src/widget/pane_grid
parent4dc5bffdfbfb09a017f35c12b484301fcf044876 (diff)
parentdcc4bb77e942f8550b0d7ee08fa5a2882fd22ecd (diff)
downloadiced-8493ccec7fd4639aef9e02ad3519a7a3707cd488.tar.gz
iced-8493ccec7fd4639aef9e02ad3519a7a3707cd488.tar.bz2
iced-8493ccec7fd4639aef9e02ad3519a7a3707cd488.zip
Merge branch 'intuitive-pane-grid-resize' into feature/pane-grid-titlebar
Diffstat (limited to 'native/src/widget/pane_grid')
-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)]