diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2016-11-09 12:59:56 +0100 |
---|---|---|
committer | Ivo van Dongen <ivovandongen@users.noreply.github.com> | 2016-11-11 18:00:15 +0100 |
commit | 8c02a2be1ee6a6cda10d47953e81dab34b4e09c9 (patch) | |
tree | d22d20086487fe6230514ab1598c49c4d846b355 | |
parent | 2256757e53db78cb16d50cb50bdcc84239e9f247 (diff) | |
download | qtlocation-mapboxgl-8c02a2be1ee6a6cda10d47953e81dab34b4e09c9.tar.gz |
[android] update viewport size when framebuffer size changed
-rwxr-xr-x | platform/android/src/native_map_view.cpp | 6 | ||||
-rwxr-xr-x | platform/android/src/native_map_view.hpp | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/platform/android/src/native_map_view.cpp b/platform/android/src/native_map_view.cpp index 65e39b198e..c1283693d0 100755 --- a/platform/android/src/native_map_view.cpp +++ b/platform/android/src/native_map_view.cpp @@ -197,6 +197,11 @@ void NativeMapView::invalidate() { void NativeMapView::render() { activate(); + if (framebufferSizeChanged) { + getContext().viewport = { 0, 0, getFramebufferSize() }; + framebufferSizeChanged = false; + } + updateViewBinding(); map->render(*this); @@ -729,6 +734,7 @@ void NativeMapView::resizeView(int w, int h) { void NativeMapView::resizeFramebuffer(int w, int h) { fbWidth = w; fbHeight = h; + framebufferSizeChanged = true; invalidate(); } diff --git a/platform/android/src/native_map_view.hpp b/platform/android/src/native_map_view.hpp index 09619802ce..18f9ebc144 100755 --- a/platform/android/src/native_map_view.hpp +++ b/platform/android/src/native_map_view.hpp @@ -90,6 +90,7 @@ private: int height = 0; int fbWidth = 0; int fbHeight = 0; + bool framebufferSizeChanged = true; int availableProcessors = 0; size_t totalMemory = 0; |