Fix: Larger touch area in object rotate mode#12
Draft
tordans wants to merge 2 commits into
Draft
Conversation
Disable map pan and screen rotation while rotating a selected object so two-finger rotation is not stolen by competing gestures. Add a single-finger pan gesture that rotates around the object center anywhere on the map view. Reset per-frame rotation delta for two-finger object rotation. Co-authored-by: Tobias <t@tobiasjordans.de>
- Do not exit rotate mode when one-finger pan is cancelled (e.g. second finger added for two-finger rotation) - Block object rotation gestures on toolbar controls - Disable scroll-wheel zoom during object rotate mode Co-authored-by: Tobias <t@tobiasjordans.de>
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.
Problem (User Story)
As an OpenStreetMap editor using Go Map
I want to rotate a selected object in rotate mode using the entire map area
So that I do not have to aim at a small cyan overlay and rotation works reliably.
Current behavior: In rotate mode, the effective touch target for rotation is very small (visually only a narrow arc around the object). Finger movement on the display often does not rotate the object — instead the map pans or other gestures take over.
Expected behavior: In rotate mode, the full map view (at least the entire
MapView) should trigger rotation — via one-finger drag or two-finger rotation.Implementation Notes (by Cursor)
isRotateObjectModeis active, map pan, screen rotation, and scroll-wheel zoom are disabled inMainViewController(setObjectRotationModeActive). Pinch was already blocked; tap-and-drag is blocked as well.UIPanGestureRecognizer(maximumNumberOfTouches = 1) onMapViewcomputes the angle between the touch point and the object center and callsEditorMapLayer.rotateContinuewith a normalized angle delta.rotationGesture.rotationis reset to0after each frame (incremental deltas, same pattern as map rotation) so rotation does not jump..cancelled/.failed(e.g. when a second finger is added for two-finger rotation).UIControl/UIToolbartouches (same pattern as tap).src/Shared/MapView.swift,src/iOS/MainViewController.swiftTesting Notes (by @tordans)