summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2023-08-03 20:31:37 +0200
committerLibravatar GitHub <noreply@github.com>2023-08-03 20:31:37 +0200
commitcb8b70bec3e8bbf809e7d8ffc559adb712f45e14 (patch)
tree2eda3276da1fd88a0c7a9b6830883d5e40d21bb3
parentdd6d8875585796252f6b54c950a1c9b143d00904 (diff)
parent30d5361f6369bb0f619191c38de51561bd4b26cc (diff)
downloadiced-cb8b70bec3e8bbf809e7d8ffc559adb712f45e14.tar.gz
iced-cb8b70bec3e8bbf809e7d8ffc559adb712f45e14.tar.bz2
iced-cb8b70bec3e8bbf809e7d8ffc559adb712f45e14.zip
Merge pull request #1998 from malramsay64/image_viewer_scroll
fix: Check cursor in bounds when scrolling image::Viewer
-rw-r--r--CHANGELOG.md2
-rw-r--r--widget/src/image/viewer.rs2
2 files changed, 3 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e3637149..8e838f8d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -81,6 +81,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `BorderRadius` not exposed in root crate. [#1972](https://github.com/iced-rs/iced/pull/1972)
- Outdated `ROADMAP`. [#1958](https://github.com/iced-rs/iced/pull/1958)
- `iced_wgpu` freezing on empty layers. [#1996](https://github.com/iced-rs/iced/pull/1996)
+- `image::Viewer` reacting to any scroll event. [#1998](https://github.com/iced-rs/iced/pull/1998)
Many thanks to...
@@ -99,6 +100,7 @@ Many thanks to...
- @JonathanLindsey
- @kr105
- @marienz
+- @malramsay64
- @nicksenger
- @nicoburns
- @Redhawk18
diff --git a/widget/src/image/viewer.rs b/widget/src/image/viewer.rs
index 0038f858..6e095667 100644
--- a/widget/src/image/viewer.rs
+++ b/widget/src/image/viewer.rs
@@ -154,7 +154,7 @@ where
match event {
Event::Mouse(mouse::Event::WheelScrolled { delta }) => {
- let Some(cursor_position) = cursor.position() else {
+ let Some(cursor_position) = cursor.position_over(bounds) else {
return event::Status::Ignored;
};