diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2017-09-12 07:20:59 -0400 |
---|---|---|
committer | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2017-09-15 16:41:29 -0300 |
commit | 45d07163eb3a52de3b959e4b5cd624e346d72ddb (patch) | |
tree | e9fac2e201ba310f611dc6f0b2426fab6f21482b | |
parent | 0f9773e615e0790e7559d5ec4a9cb331edc13a93 (diff) | |
download | qtlocation-mapboxgl-45d07163eb3a52de3b959e4b5cd624e346d72ddb.tar.gz |
[core] Reset zoom history state in still mode
-rw-r--r-- | src/mbgl/renderer/renderer_impl.cpp | 11 | ||||
-rw-r--r-- | test/api/zoom_history.cpp | 6 |
2 files changed, 15 insertions, 2 deletions
diff --git a/src/mbgl/renderer/renderer_impl.cpp b/src/mbgl/renderer/renderer_impl.cpp index b8b87d0343..a5d23333ac 100644 --- a/src/mbgl/renderer/renderer_impl.cpp +++ b/src/mbgl/renderer/renderer_impl.cpp @@ -68,8 +68,15 @@ void Renderer::Impl::setObserver(RendererObserver* observer_) { } void Renderer::Impl::render(const UpdateParameters& updateParameters) { - // Don't load/render anyting in still mode until explicitly requested. - if (updateParameters.mode == MapMode::Still && !updateParameters.stillImageRequest) return; + if (updateParameters.mode == MapMode::Still) { + // Don't load/render anyting in still mode until explicitly requested. + if (!updateParameters.stillImageRequest) { + return; + } + + // Reset zoom history state. + zoomHistory.first = true; + } assert(BackendScope::exists()); diff --git a/test/api/zoom_history.cpp b/test/api/zoom_history.cpp index 3c60a5e2f2..1b1159bf52 100644 --- a/test/api/zoom_history.cpp +++ b/test/api/zoom_history.cpp @@ -62,4 +62,10 @@ TEST(API, ZoomHistory) { // ZoomHistory.lastIntegerZoom should be 0. map->setZoom(0.5); test::checkImage("test/fixtures/zoom_history", frontend.render(*map), 0.0002); + + map->setZoom(1.0); + frontend.render(*map); + + map->setZoom(0.5); + test::checkImage("test/fixtures/zoom_history", frontend.render(*map), 0.0002); } |