summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2020-05-31 12:10:35 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2020-05-31 12:10:35 +0200
commit05e7f467bd6c062a4b658d3a60bbadee804c7efc (patch)
tree37c2c2a7f94a51f52a2340eb24f3c6491741ffd6
parenta0b0ae5396df26c1a65081b093709696a0c0166e (diff)
downloadgdx-boardgame-05e7f467bd6c062a4b658d3a60bbadee804c7efc.zip
gdx-boardgame-05e7f467bd6c062a4b658d3a60bbadee804c7efc.tar.gz
Camera : fix translate
-rw-r--r--core/src/ch/asynk/gdx/boardgame/Camera.java2
-rw-r--r--test/src/ch/asynk/gdx/boardgame/test/AbstractScreen.java4
2 files changed, 3 insertions, 3 deletions
diff --git a/core/src/ch/asynk/gdx/boardgame/Camera.java b/core/src/ch/asynk/gdx/boardgame/Camera.java
index d72f15c..322c6d5 100644
--- a/core/src/ch/asynk/gdx/boardgame/Camera.java
+++ b/core/src/ch/asynk/gdx/boardgame/Camera.java
@@ -153,7 +153,7 @@ public class Camera extends OrthographicCamera
{
float deltaX = (dx * zoom * widthFactor);
float deltaY = (dy * zoom * heightFactor);
- translate(deltaX, -deltaY, 0);
+ translate(-deltaX, deltaY, 0);
clampPosition();
update(true);
}
diff --git a/test/src/ch/asynk/gdx/boardgame/test/AbstractScreen.java b/test/src/ch/asynk/gdx/boardgame/test/AbstractScreen.java
index 4c51780..b8c4acb 100644
--- a/test/src/ch/asynk/gdx/boardgame/test/AbstractScreen.java
+++ b/test/src/ch/asynk/gdx/boardgame/test/AbstractScreen.java
@@ -158,8 +158,8 @@ public abstract class AbstractScreen implements Screen
}
@Override public boolean touchDragged(int x, int y, int pointer)
{
- int dx = (int) (dragPos.x - x);
- int dy = (int) (dragPos.y - y);
+ int dx = (int) (x - dragPos.x);
+ int dy = (int) (y - dragPos.y);
dragPos.set(x, y);
onDragged(dx, dy);
return true;