handle pivot for Viewport.rotateMap() and .scaleMap() consistenly
This commit is contained in:
parent
2525b60f86
commit
e300664a28
@ -588,8 +588,8 @@ public abstract class GdxMap implements ApplicationListener {
|
||||
|
||||
mBeginRotate = true;
|
||||
|
||||
mFocusX = (mWidth / 2) - (x1 + x2) / 2;
|
||||
mFocusY = (mHeight / 2) - (y1 + y2) / 2;
|
||||
mFocusX = (x1 + x2) / 2 - (mWidth / 2);
|
||||
mFocusY = (y1 + y2) / 2 - (mHeight / 2);
|
||||
} else {
|
||||
double da = rad - mAngle;
|
||||
mSumRotate += da;
|
||||
|
@ -477,8 +477,8 @@ public class Viewport {
|
||||
double rsin = Math.sin(radians);
|
||||
double rcos = Math.cos(radians);
|
||||
|
||||
float x = (float) (pivotX * rcos + pivotY * -rsin - pivotX);
|
||||
float y = (float) (pivotX * rsin + pivotY * rcos - pivotY);
|
||||
float x = (float) (-pivotX * rcos - pivotY * -rsin + pivotX);
|
||||
float y = (float) (-pivotX * rsin - pivotY * rcos + pivotY);
|
||||
|
||||
moveMap(x, y);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user