Skip to content
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
merged 20 commits into from
Feb 29, 2024
Merged

Add gesture support #2

merged 20 commits into from
Feb 29, 2024

Conversation

sile
Copy link
Owner

@sile sile commented Feb 29, 2024

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 and Event structs, the creation of a new gesture.rs file, and updates to the ConfigWidget.

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 a zoom method to the App struct that allows the user to zoom in and out.
  • src/event.rs: Modified the Event enum and from_pagurus_event method to handle PointerEvent and GestureEvent. [1] [2]
  • src/game.rs: Updated the Game implementation to handle PointerEvent. [1] [2]

New Files:

  • src/gesture.rs: Created a new file that defines PointerEvent, EventType, PointerType, GestureEvent, and GestureRecognizer. This file also includes methods for handling different types of touch gestures.

UI Updates:

  • src/widget/config.rs: Added a gesture field to the ConfigWidget 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, and src/widget/button.rs to accommodate the new gesture support feature.

@sile sile merged commit 23e0f2a into main Feb 29, 2024
6 checks passed
@sile sile deleted the gesture branch February 29, 2024 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant