summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2015-07-24 16:24:20 +0300
committerBruno de Oliveira Abinader <bruno@mapbox.com>2015-07-27 21:57:51 +0300
commit5e2f3b1323331f6cfa72bdbf7ae59db275c70f26 (patch)
tree054e5fbfc6d69e5f5cabeb02a9cf964e2c50afa9 /platform
parent44182a30cf8374d3e35d6bc5a4275c7f6d61b108 (diff)
downloadqtlocation-mapboxgl-5e2f3b1323331f6cfa72bdbf7ae59db275c70f26.tar.gz
Avoid nudging transitions if a gesture is in progress #2
Following the same steps from #1548 and #1912 for GLFW and iOS ports. Also removed a redundant check if transform state is changing since we're already dealing with that.
Diffstat (limited to 'platform')
-rw-r--r--platform/default/glfw_view.cpp5
-rw-r--r--platform/ios/MGLMapView.mm6
2 files changed, 10 insertions, 1 deletions
diff --git a/platform/default/glfw_view.cpp b/platform/default/glfw_view.cpp
index e83a832728..49ae8c4f68 100644
--- a/platform/default/glfw_view.cpp
+++ b/platform/default/glfw_view.cpp
@@ -336,7 +336,10 @@ void GLFWView::run() {
const bool dirty = !clean.test_and_set();
if (dirty) {
const bool needsRerender = map->renderSync();
- map->nudgeTransitions(needsRerender);
+ GLFWView *view = reinterpret_cast<GLFWView *>(glfwGetWindowUserPointer(window));
+ if (!view->tracking || !view->rotating) {
+ map->nudgeTransitions(needsRerender);
+ }
}
}
}
diff --git a/platform/ios/MGLMapView.mm b/platform/ios/MGLMapView.mm
index f4dea9baeb..0cce29ba1d 100644
--- a/platform/ios/MGLMapView.mm
+++ b/platform/ios/MGLMapView.mm
@@ -707,6 +707,12 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration)
[self updateUserLocationAnnotationView];
+ // don't nudge transitions if in the midst of a gesture.
+ if (self.pan.state == UIGestureRecognizerStateChanged ||
+ self.pinch.state == UIGestureRecognizerStateChanged ||
+ self.rotate.state == UIGestureRecognizerStateChanged ||
+ self.quickZoom.state == UIGestureRecognizerStateChanged) return;
+
_mbglMap->nudgeTransitions(needsRerender);
}
}