diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2016-11-09 12:59:56 +0100 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2016-11-10 17:04:18 +0100 |
commit | 108a28faa88745ee15de0c29990b3bda9a3ea9e6 (patch) | |
tree | f0e7764d6e454e7021c96c67b274b59a061f96b7 | |
parent | d0e8ed4bc30c62b5b6894534e4cf816acb414efa (diff) | |
download | qtlocation-mapboxgl-108a28faa88745ee15de0c29990b3bda9a3ea9e6.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 a472525065..f570f7e68e 100755 --- a/platform/android/src/native_map_view.cpp +++ b/platform/android/src/native_map_view.cpp @@ -177,6 +177,11 @@ void NativeMapView::invalidate() { void NativeMapView::render() { activate(); + if (framebufferSizeChanged) { + getContext().viewport = { 0, 0, getFramebufferSize() }; + framebufferSizeChanged = false; + } + updateViewBinding(); map->render(*this); @@ -688,6 +693,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; |