Skip to content

Fix: Larger touch area in object rotate mode#12

Draft
tordans wants to merge 2 commits into
masterfrom
cursor/rotate-object-touch-area-c13b
Draft

Fix: Larger touch area in object rotate mode#12
tordans wants to merge 2 commits into
masterfrom
cursor/rotate-object-touch-area-c13b

Conversation

@tordans

@tordans tordans commented May 31, 2026

Copy link
Copy Markdown
Owner

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)

  • Disable competing gestures: While isRotateObjectMode is active, map pan, screen rotation, and scroll-wheel zoom are disabled in MainViewController (setObjectRotationModeActive). Pinch was already blocked; tap-and-drag is blocked as well.
  • One-finger rotation across the map: New UIPanGestureRecognizer (maximumNumberOfTouches = 1) on MapView computes the angle between the touch point and the object center and calls EditorMapLayer.rotateContinue with a normalized angle delta.
  • Two-finger rotation: rotationGesture.rotation is reset to 0 after each frame (incremental deltas, same pattern as map rotation) so rotation does not jump.
  • Review follow-ups:
    • One-finger pan no longer exits rotate mode on .cancelled/.failed (e.g. when a second finger is added for two-finger rotation).
    • Object rotation gestures are rejected on UIControl/UIToolbar touches (same pattern as tap).
    • Scroll-wheel zoom is disabled/guarded during rotate mode (Mac Catalyst parity with pinch/pan).
  • Files changed: src/Shared/MapView.swift, src/iOS/MainViewController.swift

Testing Notes (by @tordans)

  • Select a way or multipolygon → Edit → enable Rotate
  • One finger: Drag in a circular motion anywhere on the map (not only on the cyan arc) → object rotates around its center
  • Two fingers: Rotate on different map areas (center, edges, top/bottom)
  • One finger then two: Start with one finger, add a second → rotate mode stays active and two-finger rotation works
  • While in rotate mode: map should not pan with one finger (pan disabled)
  • While in rotate mode on Mac: scroll-wheel zoom should not work
  • Dragging on the edit toolbar should not rotate the object
  • After ending the gesture: rotate mode exits as before (push pin reappears)
  • A short tap on the map still exits rotate mode
  • Optional: Mac Catalyst / trackpad with two fingers
  • Regression: normal pan/zoom/map rotation outside rotate mode unchanged
Open in Web Open in Cursor 

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>
@tordans tordans closed this Jun 6, 2026
@tordans tordans reopened this Jun 6, 2026
@cursor cursor Bot changed the title Fix: Größere Berührfläche im Objekt-Drehmodus Fix: Larger touch area in object rotate mode Jun 6, 2026
- 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>
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.

2 participants