summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2016-11-09 12:59:56 +0100
committerIvo van Dongen <ivovandongen@users.noreply.github.com>2016-11-11 18:00:15 +0100
commit8c02a2be1ee6a6cda10d47953e81dab34b4e09c9 (patch)
treed22d20086487fe6230514ab1598c49c4d846b355
parent2256757e53db78cb16d50cb50bdcc84239e9f247 (diff)
downloadqtlocation-mapboxgl-8c02a2be1ee6a6cda10d47953e81dab34b4e09c9.tar.gz
[android] update viewport size when framebuffer size changed
-rwxr-xr-xplatform/android/src/native_map_view.cpp6
-rwxr-xr-xplatform/android/src/native_map_view.hpp1
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;