From aaa1e3a6f1a69749371f51bbe96a1908e4bf09e2 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Wed, 22 Oct 2014 14:59:12 -0700 Subject: [PATCH] Remove rotation constraints This should be an iOS SDK option, not hard coded into low-level renderering. Fixes #458 --- include/mbgl/map/map.hpp | 1 - include/mbgl/map/transform.hpp | 1 - src/map/map.cpp | 4 ---- src/map/transform.cpp | 12 ------------ 4 files changed, 18 deletions(-) diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp index 43402fe2e..ad33865cd 100644 --- a/include/mbgl/map/map.hpp +++ b/include/mbgl/map/map.hpp @@ -115,7 +115,6 @@ public: void resetNorth(); void startRotating(); void stopRotating(); - bool canRotate(); // Debug void setDebug(bool value); diff --git a/include/mbgl/map/transform.hpp b/include/mbgl/map/transform.hpp index e3604edd8..a42b7aa10 100644 --- a/include/mbgl/map/transform.hpp +++ b/include/mbgl/map/transform.hpp @@ -51,7 +51,6 @@ public: double getAngle() const; void startRotating(); void stopRotating(); - bool canRotate(); // Transitions bool needsTransition() const; diff --git a/src/map/map.cpp b/src/map/map.cpp index 6e9e47fd5..3daaa8798 100644 --- a/src/map/map.cpp +++ b/src/map/map.cpp @@ -551,10 +551,6 @@ void Map::stopRotating() { update(); } -bool Map::canRotate() { - return transform.canRotate(); -} - #pragma mark - Toggles diff --git a/src/map/transform.cpp b/src/map/transform.cpp index 25aacd483..03e06f984 100644 --- a/src/map/transform.cpp +++ b/src/map/transform.cpp @@ -14,7 +14,6 @@ using namespace mbgl; const double D2R = M_PI / 180.0; const double M2PI = 2 * M_PI; -const double MIN_ROTATE_SCALE = 8; Transform::Transform(View &view_) : view(view_) @@ -37,7 +36,6 @@ bool Transform::resize(const uint16_t w, const uint16_t h, const float ratio, current.pixelRatio = final.pixelRatio = ratio; current.framebuffer[0] = final.framebuffer[0] = fb_w; current.framebuffer[1] = final.framebuffer[1] = fb_h; - if (!canRotate() && current.angle) _setAngle(0); constrain(current.scale, current.y); view.notify_map_change(MapChangeRegionDidChange); @@ -286,9 +284,6 @@ void Transform::_setScaleXY(const double new_scale, const double xn, const doubl constrain(final.scale, final.y); - // Undo rotation at low zooms. - if (!canRotate() && current.angle) _setAngle(0); - if (duration == 0) { current.scale = final.scale; current.x = final.x; @@ -398,9 +393,6 @@ void Transform::_setAngle(double new_angle, const timestamp duration) { final.angle = new_angle; - // Prevent rotation at low zooms. - if (!canRotate()) final.angle = 0; - if (duration == 0) { current.angle = final.angle; } else { @@ -449,10 +441,6 @@ void Transform::_clearRotating() { } } -bool Transform::canRotate() { - return (current.scale > MIN_ROTATE_SCALE); -} - #pragma mark - Transition bool Transform::needsTransition() const {