remove start_x/y variables, they're unused

This commit is contained in:
Konstantin Käfer
2014-04-16 10:46:52 -04:00
parent cc8be772f8
commit 1b922e3a34
5 changed files with 7 additions and 11 deletions

View File

@@ -136,10 +136,7 @@ public:
if (button == GLFW_MOUSE_BUTTON_RIGHT || (button == GLFW_MOUSE_BUTTON_LEFT && modifiers & GLFW_MOD_CONTROL)) {
mapView->rotating = action == GLFW_PRESS;
if (mapView->rotating) {
mapView->start_x = mapView->last_x;
mapView->start_y = mapView->last_y;
} else {
if (!mapView->rotating) {
mapView->map.stopRotating();
}
} else if (button == GLFW_MOUSE_BUTTON_LEFT) {
@@ -167,7 +164,7 @@ public:
}
} else if (mapView->rotating) {
mapView->map.startRotating();
mapView->map.rotateBy(mapView->start_x, mapView->start_y, mapView->last_x, mapView->last_y, x, y);
mapView->map.rotateBy(mapView->last_x, mapView->last_y, x, y);
}
mapView->last_x = x;
mapView->last_y = y;
@@ -222,7 +219,6 @@ public:
double last_x = 0, last_y = 0;
bool tracking = false;
double start_x = 0, start_y = 0;
bool rotating = false;
double last_click = -1;

View File

@@ -57,7 +57,7 @@ public:
void stopScaling();
/* rotation */
void rotateBy(double cx, double cy, double sx, double sy, double ex, double ey, double duration = 0);
void rotateBy(double sx, double sy, double ex, double ey, double duration = 0);
void setAngle(double angle, double cx = -1, double cy = -1, double duration = 0);
double getAngle() const;
void resetNorth();

View File

@@ -29,7 +29,7 @@ public:
// Relative changes
void moveBy(double dx, double dy, double duration = 0);
void scaleBy(double ds, double cx = -1, double cy = -1, double duration = 0);
void rotateBy(double cx, double cy, double sx, double sy, double ex, double ey, double duration = 0);
void rotateBy(double sx, double sy, double ex, double ey, double duration = 0);
// Absolute changes
void setScale(double scale, double cx = -1, double cy = -1, double duration = 0);

View File

@@ -137,8 +137,8 @@ void Map::stopScaling() {
platform::restart();
}
void Map::rotateBy(double cx, double cy, double sx, double sy, double ex, double ey, double duration) {
transform.rotateBy(cx, cy, sx, sy, ex, ey, duration);
void Map::rotateBy(double sx, double sy, double ex, double ey, double duration) {
transform.rotateBy(sx, sy, ex, ey, duration);
update();
settings.angle = transform.getAngle();

View File

@@ -107,7 +107,7 @@ void Transform::stopScaling() {
}
}
void Transform::rotateBy(double anchor_x, double anchor_y, double start_x, double start_y, double end_x, double end_y, double duration) {
void Transform::rotateBy(double start_x, double start_y, double end_x, double end_y, double duration) {
double center_x = width / 2, center_y = height / 2;
const double begin_center_x = start_x - center_x;