diff options
| author | Nathan Reiner <nathan@nathanreiner.xyz> | 2024-01-21 22:25:05 +0100 |
|---|---|---|
| committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2024-01-21 22:25:05 +0100 |
| commit | 895240accc908009a33b9fc388b18c7288765c9b (patch) | |
| tree | bd6635aa45aba93841e2876a5d028176af130526 /src/ui/graph.rs | |
| parent | bef4b17d7f5c20b55a48bf847442a1261c1b299d (diff) | |
graph only overwrite mouse shape if it's in bounds
Diffstat (limited to 'src/ui/graph.rs')
| -rw-r--r-- | src/ui/graph.rs | 7 |
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, |