Remove rotation constraints

This should be an iOS SDK option, not hard coded into
low-level renderering.

Fixes #458
This commit is contained in:
John Firebaugh
2014-10-22 14:59:12 -07:00
parent b45b855b41
commit aaa1e3a6f1
4 changed files with 0 additions and 18 deletions

View File

@@ -115,7 +115,6 @@ public:
void resetNorth();
void startRotating();
void stopRotating();
bool canRotate();
// Debug
void setDebug(bool value);

View File

@@ -51,7 +51,6 @@ public:
double getAngle() const;
void startRotating();
void stopRotating();
bool canRotate();
// Transitions
bool needsTransition() const;

View File

@@ -551,10 +551,6 @@ void Map::stopRotating() {
update();
}
bool Map::canRotate() {
return transform.canRotate();
}
#pragma mark - Toggles

View File

@@ -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 {