Forward trackpad pinch (magnify) gestures as mouse::Event::PinchGesture#3377
Open
hn63wospuvy wants to merge 1 commit into
Open
Forward trackpad pinch (magnify) gestures as mouse::Event::PinchGesture#3377hn63wospuvy wants to merge 1 commit into
mouse::Event::PinchGesture#3377hn63wospuvy wants to merge 1 commit into
Conversation
winit emits `WindowEvent::PinchGesture` for trackpad magnify gestures, but
the winit backend dropped it, so applications had no way to implement
pinch-to-zoom. Add a `mouse::Event::PinchGesture { delta }` variant and
forward the gesture from `iced_winit`'s event conversion.
`delta` is the incremental magnification change (positive = zoom in).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
winitemitsWindowEvent::PinchGesturefor trackpad magnify (pinch) gestures, but theiced_winitevent conversion dropped it, so applications had no way to implement pinch-to-zoom.This adds a
mouse::Event::PinchGesture { delta }variant and forwards the gesture from the winit backend.deltais the incremental magnification change since the previous event (positive = zooming in / fingers moving apart).The
mouse::Eventdoc-comment already invites such additions ("This type is largely incomplete! If you need to track additional events, feel free to open an issue and share your use case!").Changes
core: addmouse::Event::PinchGesture { delta: f32 }.winit: convertWindowEvent::PinchGesture-> the new event.The change is additive (one enum variant + one conversion arm); the full workspace (all crates + examples) compiles.