diff --git a/platform/android/src/native_map_view.cpp b/platform/android/src/native_map_view.cpp index 17b7755a2..23eb39dab 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); } diff --git a/platform/android/src/native_map_view.hpp b/platform/android/src/native_map_view.hpp index bc5d457f5..5926f781a 100755 --- a/platform/android/src/native_map_view.hpp +++ b/platform/android/src/native_map_view.hpp @@ -75,8 +75,8 @@ private: std::string apiKey; bool firstTime = false; - bool fpsEnabled = false; + bool sizeChanged = false; double fps = 0.0; int width = 0;