fix: Check cursor in bounds when scrolling image::Viewer
Ensure that the cursor is within the bounds of the image::Viewer when performing the scrolling. Fixes #1997
This commit is contained in:
parent
dd6d887558
commit
004a1f3848
1 changed files with 2 additions and 1 deletions
|
|
@ -154,7 +154,8 @@ where
|
||||||
|
|
||||||
match event {
|
match event {
|
||||||
Event::Mouse(mouse::Event::WheelScrolled { delta }) => {
|
Event::Mouse(mouse::Event::WheelScrolled { delta }) => {
|
||||||
let Some(cursor_position) = cursor.position() else {
|
// Ensure the cursor is within the bounds of the widget
|
||||||
|
let Some(cursor_position) = cursor.position_over(bounds) else {
|
||||||
return event::Status::Ignored;
|
return event::Status::Ignored;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue