Merge pull request #1998 from malramsay64/image_viewer_scroll

fix: Check cursor in bounds when scrolling image::Viewer
This commit is contained in:
Héctor Ramón 2023-08-03 20:31:37 +02:00 committed by GitHub
commit cb8b70bec3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -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

View file

@ -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;
};