Repository navigation
[ios] Add threshold for triggering the rotate gesture recognizer - #14929
Conversation
4c07cc2 to
62edef6
Compare
62edef6 to
3ae5382
Compare
|
My current approach:
The threshold currently applies to all rotation gestures, not just when the rotation gesture recognizer is triggered while pinching. |
|
I've changed my approach to match the approach that Android takes, which is to provide a I am seeing an issue where the map can snap back while rotating without pinching, and would love to pair with someone to work out what is happening. |
|
Thanks @fabian-guerra for helping me to troubleshoot. Using the I have started writing tests for these changes. |
| [self cancelTransitions]; | ||
|
|
||
| if (MGLDegreesFromRadians(self.currentRotation) < self.rotationThreshold && self.isZooming) { | ||
| [self notifyGestureDidBegin]; |
There was a problem hiding this comment.
Is this when the gesture begins? This looks like where the gesture is being explicitly kept from beginning.
There was a problem hiding this comment.
The exception that I see from the return; is happening when _changeDelimiterSuppressionDepth is < 0. Just calling _changeDelimiterSuppressionDepth++; seems to make the first rotation jump to a new rotation. I still see that jumpiness occasionally when calling notifyGestureDidBegin.
Right now, this code is still being called when the rotation gesture ends/fails, even if the map doesn't rotate:
mapbox-gl-native/platform/ios/src/MGLMapView.mm
Lines 1808 to 1815 in 4474ef6
Removing return may work better. The camera animations, tracking, etc. are going to be cancelled by the pinch gesture recognizer that is also being triggered.
|
Current approach is to adjust the threshold internally. The rotation threshold is currently 3 degrees, which should make the rotation slightly less easy to trigger. |
Co-Authored-By: Jason Wray <[email protected]>
|
@jmkiley @chloekraw Since these are significant changes and we will only have a maximum of one week of testing before the stable release, I’d like to propose that we don’t enable this by default and instead keep it behind a feature flag — that would make it available for further testing, but not expose the entire install base to a potentially buggy change. |
Co-Authored-By: Jason Wray <[email protected]>
|
I think this is ready for re-review. I removed the changelog entry since this is a feature flag, but let me know if I should add it back in. |
| { | ||
| if ( ! self.isRotateEnabled) return; | ||
|
|
||
| if ([[NSUserDefaults standardUserDefaults] objectForKey:MGLRotationThresholdWhileZoomingKey]) { |
There was a problem hiding this comment.
This check might be better done where the UIRotationGestureRecognizer is setup in the first place - i.e. change the selector.
There was a problem hiding this comment.
We might want to keep it in here in case the rotation threshold changes after the commonInit.
julianrex
left a comment
There was a problem hiding this comment.
Thanks for this! Let's ticket up the tail work.
|
🎊 Congrats on landing this, @jmkiley! |
Addresses #6562
I'm currently using a higher minimum rotation (+/- 50 degrees) for debugging purposes.
Current issues:
cc @chloekraw