From 4a0015c5ab80fb2943328d2eaf6f1b4e2fb3e666 Mon Sep 17 00:00:00 2001 From: Ansis Brammanis Date: Tue, 20 May 2014 16:26:14 -0400 Subject: [PATCH 1/3] shift dblclick zooms out --- common/glfw_view.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common/glfw_view.cpp b/common/glfw_view.cpp index e03b5ed2f..dcfaf6591 100644 --- a/common/glfw_view.cpp +++ b/common/glfw_view.cpp @@ -134,7 +134,11 @@ void GLFWView::mouseclick(GLFWwindow *window, int button, int action, int modifi view->map->stopPanning(); double now = glfwGetTime(); if (now - view->last_click < 0.4 /* ms */) { - view->map->scaleBy(2.0, view->last_x, view->last_y, 0.5); + if (modifiers & GLFW_MOD_SHIFT) { + view->map->scaleBy(0.5, view->last_x, view->last_y, 0.5); + } else { + view->map->scaleBy(2.0, view->last_x, view->last_y, 0.5); + } } view->last_click = now; } From 362c055aa6fd030b5491c23435f6fd7f008e2be7 Mon Sep 17 00:00:00 2001 From: Ansis Brammanis Date: Tue, 20 May 2014 20:08:32 -0400 Subject: [PATCH 2/3] remove line causing flickering --- src/renderer/painter_text.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/renderer/painter_text.cpp b/src/renderer/painter_text.cpp index e58de29b2..01bfa8502 100644 --- a/src/renderer/painter_text.cpp +++ b/src/renderer/painter_text.cpp @@ -79,7 +79,6 @@ void Painter::renderText(TextBucket& bucket, const std::string& layer_name, cons // Calculate the speed of zooming, and how far it would zoom in terms of zoom levels in one duration float zoomDiff = endingZ - history[1].z, timeDiff = lastFrame.timestamp - history[1].timestamp; - if (timeDiff > duration) timeDiff = 1; float fadedist = zoomDiff / (timeDiff / duration); if (isnan(fadedist)) fprintf(stderr, "fadedist should never be NaN\n"); From 2c1d4c4678b2c42a3aa8b10db6a7af1059f0f8ce Mon Sep 17 00:00:00 2001 From: Ansis Brammanis Date: Tue, 20 May 2014 20:14:47 -0400 Subject: [PATCH 3/3] fix "bumped" zoom for label fading fixes #138 --- src/renderer/painter_text.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/painter_text.cpp b/src/renderer/painter_text.cpp index 01bfa8502..f2e458d8c 100644 --- a/src/renderer/painter_text.cpp +++ b/src/renderer/painter_text.cpp @@ -90,7 +90,7 @@ void Painter::renderText(TextBucket& bucket, const std::string& layer_name, cons textShader->setFadeDist(fadedist * 10); textShader->setMinFadeZoom(std::floor(lowZ * 10)); textShader->setMaxFadeZoom(std::floor(highZ * 10)); - textShader->setFadeZoom((map.getState().getZoom() + bump) * 10); + textShader->setFadeZoom((map.getState().getNormalizedZoom() + bump) * 10); // We're drawing in the translucent pass which is bottom-to-top, so we need // to draw the halo first.