summaryrefslogtreecommitdiffstats
path: root/native/src/widget
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-03-11 23:26:45 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-03-11 23:26:45 +0100
commitf09b4bd4f4113872eeac67320e79f81eac0a948f (patch)
treeb4d5905e165479382de7e10efb934411486f2ad4 /native/src/widget
parentdf6e3f8da921a98c9a1e75a1790885a07485ee45 (diff)
downloadiced-f09b4bd4f4113872eeac67320e79f81eac0a948f.tar.gz
iced-f09b4bd4f4113872eeac67320e79f81eac0a948f.tar.bz2
iced-f09b4bd4f4113872eeac67320e79f81eac0a948f.zip
Round region dimensions of panes to avoid overlaps
Diffstat (limited to 'native/src/widget')
-rw-r--r--native/src/widget/pane_grid.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/native/src/widget/pane_grid.rs b/native/src/widget/pane_grid.rs
index 7fc12176..3b68b99e 100644
--- a/native/src/widget/pane_grid.rs
+++ b/native/src/widget/pane_grid.rs
@@ -552,7 +552,7 @@ impl Split {
) -> (Rectangle, Rectangle) {
match self {
Split::Horizontal => {
- let width_left = rectangle.width * ratio;
+ let width_left = (rectangle.width * ratio).round();
let width_right = rectangle.width - width_left;
(
@@ -568,7 +568,7 @@ impl Split {
)
}
Split::Vertical => {
- let height_top = rectangle.height * ratio;
+ let height_top = (rectangle.height * ratio).round();
let height_bottom = rectangle.height - height_top;
(