From 143feac6a2e1e8c271a2906ecf57aefa66150c0d Mon Sep 17 00:00:00 2001 From: Fabian Guerra Date: Fri, 23 Aug 2019 17:05:45 -0700 Subject: [ios] Add comments to clarify the tilt gesture initialization. --- platform/ios/src/MGLMapView.mm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index 86017c9fbd..3fc692f4e0 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -2146,7 +2146,12 @@ public: if (twoFingerDrag.state == UIGestureRecognizerStateBegan) { CGPoint midPoint = [twoFingerDrag translationInView:twoFingerDrag.view]; - // Creates an angle at the beginning of the gesture + // In the following if and for the first execution middlePoint + // will be equal to dragGestureMiddlePoint and the resulting + // gestureSlopeAngle will be 0º causing a small delay, + // initializing dragGestureMiddlePoint with the current midPoint + // but substracting one point from 'y' forces an initial 90º angle + // making the gesture avoid the delay self.dragGestureMiddlePoint = CGPointMake(midPoint.x, midPoint.y-1); initialPitch = *self.mbglMap.getCameraOptions().pitch; [self notifyGestureDidBegin]; -- cgit v1.2.1