From 05e7f467bd6c062a4b658d3a60bbadee804c7efc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Sun, 31 May 2020 12:10:35 +0200 Subject: Camera : fix translate --- core/src/ch/asynk/gdx/boardgame/Camera.java | 2 +- test/src/ch/asynk/gdx/boardgame/test/AbstractScreen.java | 4 ++-- 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; -- cgit v1.1-2-g2b99