Skip to content

Commit cb8b70b

Browse files
authored
Merge pull request #1998 from malramsay64/image_viewer_scroll
fix: Check cursor in bounds when scrolling image::Viewer
2 parents dd6d887 + 30d5361 commit cb8b70b

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
8181
- `BorderRadius` not exposed in root crate. [#1972](https://github.com/iced-rs/iced/pull/1972)
8282
- Outdated `ROADMAP`. [#1958](https://github.com/iced-rs/iced/pull/1958)
8383
- `iced_wgpu` freezing on empty layers. [#1996](https://github.com/iced-rs/iced/pull/1996)
84+
- `image::Viewer` reacting to any scroll event. [#1998](https://github.com/iced-rs/iced/pull/1998)
8485

8586
Many thanks to...
8687

@@ -99,6 +100,7 @@ Many thanks to...
99100
- @JonathanLindsey
100101
- @kr105
101102
- @marienz
103+
- @malramsay64
102104
- @nicksenger
103105
- @nicoburns
104106
- @Redhawk18

widget/src/image/viewer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ where
154154

155155
match event {
156156
Event::Mouse(mouse::Event::WheelScrolled { delta }) => {
157-
let Some(cursor_position) = cursor.position() else {
157+
let Some(cursor_position) = cursor.position_over(bounds) else {
158158
return event::Status::Ignored;
159159
};
160160

0 commit comments

Comments
 (0)