diff options
author | Tobrun <tobrun.van.nuland@gmail.com> | 2016-03-08 07:30:18 -0500 |
---|---|---|
committer | Tobrun <tobrun.van.nuland@gmail.com> | 2016-03-08 08:06:55 -0500 |
commit | 20c3706536ac9e927f80a50e9ec8906dfd0d2baf (patch) | |
tree | 70ff4bb656f14a8e2c12d712900128e6857b5c38 /platform/android/src/native_map_view.cpp | |
parent | 15bc11ab233bc29a245297cca12428258ec0ce91 (diff) | |
download | qtlocation-mapboxgl-20c3706536ac9e927f80a50e9ec8906dfd0d2baf.tar.gz |
[android] #4240 - add flag to resize only when needed.
Diffstat (limited to 'platform/android/src/native_map_view.cpp')
-rwxr-xr-x | platform/android/src/native_map_view.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/platform/android/src/native_map_view.cpp b/platform/android/src/native_map_view.cpp index 17b7755a23..23eb39dab8 100755 --- a/platform/android/src/native_map_view.cpp +++ b/platform/android/src/native_map_view.cpp @@ -191,10 +191,11 @@ void NativeMapView::invalidate() { void NativeMapView::beforeRender() { mbgl::Log::Debug(mbgl::Event::Android, "NativeMapView::beforeRender()"); - // this fixes the viewport resizing issue, - // but we are calling it every time. - // we should only call this when the resizeView / resizeFramebuffer is called. - glViewport(0,0,fbWidth,fbHeight); + + if(sizeChanged){ + sizeChanged = false; + glViewport(0, 0, fbWidth, fbHeight); + } } void NativeMapView::afterRender() { @@ -751,6 +752,7 @@ void NativeMapView::updateFps() { void NativeMapView::resizeView(int w, int h) { width = w; height = h; + sizeChanged = true; map->update(mbgl::Update::Dimensions); } |