-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add gesture support #2
Merged
Conversation
This file contains 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.
This pull request mainly introduces gesture support to the application and makes related changes to several files. The most significant changes include the addition of touch gesture support, modifications to the
App
andEvent
structs, the creation of a newgesture.rs
file, and updates to theConfigWidget
.Here are the key changes:
New Features:
CHANGELOG.md
: Added touch gesture support. This includes tap to switch to the picker tool, two-finger tap to switch to the selection tool, swipe to move the camera, two-finger horizontal swipe for undo/redo, and pinch to zoom in/out.Codebase Modifications:
src/app.rs
: Added azoom
method to theApp
struct that allows the user to zoom in and out.src/event.rs
: Modified theEvent
enum andfrom_pagurus_event
method to handlePointerEvent
andGestureEvent
. [1] [2]src/game.rs
: Updated theGame
implementation to handlePointerEvent
. [1] [2]New Files:
src/gesture.rs
: Created a new file that definesPointerEvent
,EventType
,PointerType
,GestureEvent
, andGestureRecognizer
. This file also includes methods for handling different types of touch gestures.UI Updates:
src/widget/config.rs
: Added agesture
field to theConfigWidget
struct, which is a toggle widget for enabling or disabling gesture support. The widget's layout and event handling methods were updated accordingly. [1] [2] [3] [4] [5] [6] [7]Other changes include minor modifications to
src/app.rs
,src/event.rs
,src/game.rs
,src/lib.rs
,src/model/config.rs
, andsrc/widget/button.rs
to accommodate the new gesture support feature.