From 895240accc908009a33b9fc388b18c7288765c9b Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Sun, 21 Jan 2024 22:25:05 +0100 Subject: graph only overwrite mouse shape if it's in bounds --- src/ui/graph.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/ui') diff --git a/src/ui/graph.rs b/src/ui/graph.rs index 725c0dc..0c5211b 100644 --- a/src/ui/graph.rs +++ b/src/ui/graph.rs @@ -327,9 +327,12 @@ impl canvas::Program for GraphCanvas { fn mouse_interaction( &self, state: &Self::State, - _bounds: Rectangle, - _cursor: mouse::Cursor, + bounds: Rectangle, + cursor: mouse::Cursor, ) -> mouse::Interaction { + if cursor.position_in(bounds).is_none() { + return mouse::Interaction::default(); + } match state.interaction { Interaction::Grabbing => mouse::Interaction::Grabbing, _ => mouse::Interaction::Grab, -- cgit v1.2.3-70-g09d2