animate double click zooming

This commit is contained in:
Konstantin Käfer
2014-04-14 19:33:05 -04:00
parent 137172575d
commit 313be97b21

View File

@@ -147,8 +147,8 @@ public:
if (action == GLFW_RELEASE) {
mapView->map.stopPanning();
double now = glfwGetTime();
if (now - mapView->last_click < 0.4) {
mapView->map.scaleBy(2.0, mapView->last_x, mapView->last_y);
if (now - mapView->last_click < 0.4 /* ms */) {
mapView->map.scaleBy(2.0, mapView->last_x, mapView->last_y, 0.5);
}
mapView->last_click = now;
}