From 6aee86d5ff3906ee300ff992eb389d2442f063a6 Mon Sep 17 00:00:00 2001 From: Leith Bade Date: Mon, 12 Jan 2015 13:30:40 +1100 Subject: [PATCH 1/3] Correctly call resize with width and height. Fixes #746 --- platform/default/glfw_view.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/platform/default/glfw_view.cpp b/platform/default/glfw_view.cpp index 64a33321d..8f3eb831d 100644 --- a/platform/default/glfw_view.cpp +++ b/platform/default/glfw_view.cpp @@ -61,10 +61,7 @@ void GLFWView::initialize(mbgl::Map *map_) { int width, height; glfwGetWindowSize(window, &width, &height); - int fbWidth, fbHeight; - glfwGetFramebufferSize(window, &fbWidth, &fbHeight); - - resize(window, 0, 0); + resize(window, width, height); glfwSetCursorPosCallback(window, mouseMove); glfwSetMouseButtonCallback(window, mouseClick); From f05a530529ad57d2f97985f827657c22a9e8e6d9 Mon Sep 17 00:00:00 2001 From: Leith Bade Date: Mon, 12 Jan 2015 13:45:50 +1100 Subject: [PATCH 2/3] Correctly handle swapping. Fixes #666 --- platform/default/glfw_view.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/platform/default/glfw_view.cpp b/platform/default/glfw_view.cpp index 64a33321d..b3eed0080 100644 --- a/platform/default/glfw_view.cpp +++ b/platform/default/glfw_view.cpp @@ -58,6 +58,7 @@ void GLFWView::initialize(mbgl::Map *map_) { glfwSetWindowUserPointer(window, this); glfwMakeContextCurrent(window); + glfwSwapInterval(1); int width, height; glfwGetWindowSize(window, &width, &height); @@ -277,12 +278,6 @@ int GLFWView::run() { map->start(); while (!glfwWindowShouldClose(window)) { - if (map->needsSwap()) { - glfwSwapBuffers(window); - map->swapped(); - fps(); - } - glfwWaitEvents(); } @@ -306,7 +301,9 @@ void GLFWView::notify() { } void GLFWView::swap() { - glfwPostEmptyEvent(); + glfwSwapBuffers(window); + map->swapped(); + fps(); } void GLFWView::notifyMapChange(mbgl::MapChange /*change*/, mbgl::timestamp /*delay*/) { From bac75f1c7aa9e7d1a2e1a1a7c5db02b2dabefc44 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Mon, 12 Jan 2015 10:17:01 -0800 Subject: [PATCH 3/3] Allow characters outside \w to be used in token https://github.com/mapbox/mapbox-gl-js/pull/926 --- src/mbgl/util/token.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mbgl/util/token.hpp b/src/mbgl/util/token.hpp index 64192a99f..455190aab 100644 --- a/src/mbgl/util/token.hpp +++ b/src/mbgl/util/token.hpp @@ -8,6 +8,8 @@ namespace mbgl { namespace util { +const static std::string tokenReservedChars = "{}()[]<>$=:;.,^"; + // Replaces {tokens} in a string by calling the lookup function. template std::string replaceTokens(const std::string &source, const Lookup &lookup) { @@ -22,7 +24,7 @@ std::string replaceTokens(const std::string &source, const Lookup &lookup) { result.append(pos, brace); pos = brace; if (pos != end) { - for (brace++; brace != end && (std::isalnum(*brace) || *brace == '_'); brace++); + for (brace++; brace != end && tokenReservedChars.find(*brace) == std::string::npos; brace++); if (brace != end && *brace == '}') { result.append(lookup({ pos + 1, brace })); pos = brace + 1;