diff options
-rw-r--r-- | native/src/widget/pane_grid.rs | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/native/src/widget/pane_grid.rs b/native/src/widget/pane_grid.rs index 0d4a4404..7135efe4 100644 --- a/native/src/widget/pane_grid.rs +++ b/native/src/widget/pane_grid.rs @@ -131,19 +131,15 @@ impl<'a, Message, Renderer> PaneGrid<'a, Message, Renderer> { let ratio = match axis { Axis::Horizontal => { let position = - cursor_position.y - bounds.y + rectangle.y; + cursor_position.y - bounds.y - rectangle.y; - (position / (rectangle.y + rectangle.height)) - .max(0.1) - .min(0.9) + (position / rectangle.height).max(0.1).min(0.9) } Axis::Vertical => { let position = - cursor_position.x - bounds.x + rectangle.x; + cursor_position.x - bounds.x - rectangle.x; - (position / (rectangle.x + rectangle.width)) - .max(0.1) - .min(0.9) + (position / rectangle.width).max(0.1).min(0.9) } }; |