From f09b4bd4f4113872eeac67320e79f81eac0a948f Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 11 Mar 2020 23:26:45 +0100 Subject: Round region dimensions of panes to avoid overlaps --- native/src/widget/pane_grid.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'native/src/widget') 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; ( -- cgit