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.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ Painter::~Painter() {
|
||||
}
|
||||
|
||||
bool Painter::needsAnimation() const {
|
||||
return frameHistory.needsAnimation(data.getDefaultFadeDuration()) || state.isChanging();
|
||||
return frameHistory.needsAnimation(data.getDefaultFadeDuration());
|
||||
}
|
||||
|
||||
void Painter::setup() {
|
||||
|
||||
Reference in New Issue
Block a user