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 UIGestureRecognizerDelegate and PanGestureRecogniser plus default… #3597

Merged
merged 18 commits into from Apr 27, 2024

Conversation

jpedrick
Copy link
Contributor

@jpedrick jpedrick commented Mar 19, 2024

This PR adds:

  • UIGestureRecognizerDelegate -- allows multiple simultaneous gesture recognition
    • Implements the default gesture recognizer delegate for iOS to recognize all gestures simultaneously
    • WinitView - gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer: -> true
  • UIPanGestureRecognizer
  • Modifies UIRotationGestureRecognizer handing code to work identically to macOS rotation(sends change in delta instead of velocity)
  • Modifies UIPinchGestureRecognizer handing code to work identically to macOS magnify(sends change in delta instead of velocity)
  • Tested on all platforms changed
  • Added an entry to the changelog module if knowledge of this change could be valuable to users
  • Updated documentation to reflect any user-facing changes, including notes of platform-specific behavior
  • Created or updated an example program if it would help users understand this functionality
  • Updated feature matrix, if new features were added or implemented

@jpedrick jpedrick requested a review from madsmtm as a code owner March 19, 2024 21:10
Copy link
Member

@madsmtm madsmtm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gave it a quick look, will maybe take a further look later

.gitignore Outdated Show resolved Hide resolved
src/changelog/unreleased.md Outdated Show resolved Hide resolved
src/event.rs Outdated Show resolved Hide resolved
src/event.rs Outdated Show resolved Hide resolved
src/event.rs Outdated Show resolved Hide resolved
src/event.rs Outdated Show resolved Hide resolved
src/platform_impl/ios/uikit/gesture_recognizer.rs Outdated Show resolved Hide resolved
src/platform_impl/ios/view.rs Outdated Show resolved Hide resolved
src/platform_impl/ios/view.rs Outdated Show resolved Hide resolved
src/platform_impl/ios/uikit/gesture_recognizer.rs Outdated Show resolved Hide resolved
jpedrick and others added 2 commits March 21, 2024 16:37
…vior matches macos.\nRotation gesture units from iOS sent in degrees instead of radians.\nMany small changes from PR feedback.
Copy link
Member

@madsmtm madsmtm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like what you've done with storing the previous values to calculate the deltas, that makes a lot of sense to me.

src/changelog/unreleased.md Outdated Show resolved Hide resolved
src/event.rs Outdated Show resolved Hide resolved
src/platform_impl/ios/uikit/gesture_recognizer.rs Outdated Show resolved Hide resolved
src/platform_impl/ios/view.rs Outdated Show resolved Hide resolved
src/platform_impl/ios/view.rs Outdated Show resolved Hide resolved
src/platform_impl/ios/view.rs Show resolved Hide resolved
Copy link
Member

@madsmtm madsmtm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a bunch of nits, once you've fixed those I think we're good.

src/changelog/unreleased.md Outdated Show resolved Hide resolved
.cargo/config.toml Outdated Show resolved Hide resolved
src/platform/ios.rs Show resolved Hide resolved
src/platform_impl/ios/uikit/gesture_recognizer.rs Outdated Show resolved Hide resolved
src/platform_impl/ios/view.rs Show resolved Hide resolved
src/platform_impl/ios/view.rs Outdated Show resolved Hide resolved
src/platform_impl/ios/view.rs Outdated Show resolved Hide resolved
@madsmtm madsmtm mentioned this pull request Apr 27, 2024
3 tasks
@madsmtm madsmtm merged commit fd47798 into rust-windowing:master Apr 27, 2024
52 checks passed
@madsmtm madsmtm added S - enhancement Wouldn't this be the coolest? B - bug Dang, that shouldn't have happened labels Apr 27, 2024
@madsmtm
Copy link
Member

madsmtm commented Apr 27, 2024

Thanks @jpedrick, and apologies that I left this behind for like a month

kchibisov pushed a commit that referenced this pull request Apr 27, 2024
- Allow all gestures simultaneously recognized.
- Add PanGestureRecogniser with min/max number of touches.
- Fix sending delta values relative to Update instead to match macOS.
- Fix rotation gesture units from iOS to be in degrees instead of radians.

Co-authored-by: Mads Marquart <mads@marquart.dk>
@jpedrick
Copy link
Contributor Author

Thanks @jpedrick, and apologies that I left this behind for like a month

No worries, glad we got it merged!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B - bug Dang, that shouldn't have happened DS - ios S - enhancement Wouldn't this be the coolest?
Development

Successfully merging this pull request may close these issues.

None yet

3 participants