aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ui/graph.rs7
1 files changed, 5 insertions, 2 deletions
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<Message, Renderer> 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,