diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2014-10-22 14:59:12 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2014-11-20 15:13:23 -0800 |
commit | aaa1e3a6f1a69749371f51bbe96a1908e4bf09e2 (patch) | |
tree | 5d509ed469853a36f5251145345deecc8c348ca8 /src | |
parent | b45b855b411b04e8d91df4e08a0e4e6b29cb8123 (diff) | |
download | qtlocation-mapboxgl-aaa1e3a6f1a69749371f51bbe96a1908e4bf09e2.tar.gz |
Remove rotation constraints
This should be an iOS SDK option, not hard coded into
low-level renderering.
Fixes #458
Diffstat (limited to 'src')
-rw-r--r-- | src/map/map.cpp | 4 | ||||
-rw-r--r-- | src/map/transform.cpp | 12 |
2 files changed, 0 insertions, 16 deletions
diff --git a/src/map/map.cpp b/src/map/map.cpp index 6e9e47fd52..3daaa87987 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 25aacd4838..03e06f984b 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 { |