diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2016-03-12 00:50:00 +0200 |
---|---|---|
committer | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2016-03-13 21:38:20 +0200 |
commit | 8e30a4a0806e970e727c3563b8ed57dbaf9a0fa0 (patch) | |
tree | 792abd2a0b6d19aac7e60d83cfa4c2d88893b936 /platform/default/glfw_view.cpp | |
parent | a396c6a7f082749476f332c976912f37cbd93c92 (diff) | |
download | qtlocation-mapboxgl-8e30a4a0806e970e727c3563b8ed57dbaf9a0fa0.tar.gz |
[core] Harden Transform anchor & padding usage
Use optional values for anchor & padding in Map and Transform functions
instead of NaNs. Added unit tests to stress some edge cases.
Diffstat (limited to 'platform/default/glfw_view.cpp')
-rw-r--r-- | platform/default/glfw_view.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/platform/default/glfw_view.cpp b/platform/default/glfw_view.cpp index 790b0a4dd7..a931928d6d 100644 --- a/platform/default/glfw_view.cpp +++ b/platform/default/glfw_view.cpp @@ -326,7 +326,7 @@ void GLFWView::onScroll(GLFWwindow *window, double /*xOffset*/, double yOffset) scale = 1.0 / scale; } - view->map->scaleBy(scale, { view->lastX, view->lastY }); + view->map->scaleBy(scale, mbgl::ScreenCoordinate { view->lastX, view->lastY }); } void GLFWView::onWindowResize(GLFWwindow *window, int width, int height) { @@ -363,9 +363,9 @@ void GLFWView::onMouseClick(GLFWwindow *window, int button, int action, int modi double now = glfwGetTime(); if (now - view->lastClick < 0.4 /* ms */) { if (modifiers & GLFW_MOD_SHIFT) { - view->map->scaleBy(0.5, { view->lastX, view->lastY }, mbgl::Milliseconds(500)); + view->map->scaleBy(0.5, mbgl::ScreenCoordinate { view->lastX, view->lastY }, mbgl::Milliseconds(500)); } else { - view->map->scaleBy(2.0, { view->lastX, view->lastY }, mbgl::Milliseconds(500)); + view->map->scaleBy(2.0, mbgl::ScreenCoordinate { view->lastX, view->lastY }, mbgl::Milliseconds(500)); } } view->lastClick = now; |