This commit is contained in:
Eden Halperin
2014-05-20 17:18:32 -07:00
2 changed files with 6 additions and 3 deletions

View File

@@ -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;
}

View File

@@ -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");
@@ -91,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.