Cleanup std::chrono usage
Use mbgl::Duration and mbgl::{,Milli}Seconds whenever possible.
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include <mbgl/platform/log.hpp>
|
||||
#include <mbgl/util/gl_helper.hpp>
|
||||
#include <mbgl/util/string.hpp>
|
||||
#include <mbgl/util/chrono.hpp>
|
||||
|
||||
#include <cassert>
|
||||
#include <cstdlib>
|
||||
@@ -140,7 +141,7 @@ void GLFWView::onKey(GLFWwindow *window, int key, int /*scancode*/, int action,
|
||||
break;
|
||||
case GLFW_KEY_R:
|
||||
if (!mods) {
|
||||
view->map->setDefaultTransitionDuration(std::chrono::milliseconds(300));
|
||||
view->map->setDefaultTransitionDuration(mbgl::Milliseconds(300));
|
||||
if (view->map->hasClass("night")) {
|
||||
view->map->removeClass("night");
|
||||
} else {
|
||||
@@ -352,9 +353,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 }, std::chrono::milliseconds(500));
|
||||
view->map->scaleBy(0.5, { view->lastX, view->lastY }, mbgl::Milliseconds(500));
|
||||
} else {
|
||||
view->map->scaleBy(2.0, { view->lastX, view->lastY }, std::chrono::milliseconds(500));
|
||||
view->map->scaleBy(2.0, { view->lastX, view->lastY }, mbgl::Milliseconds(500));
|
||||
}
|
||||
}
|
||||
view->lastClick = now;
|
||||
|
||||
Reference in New Issue
Block a user