summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: cf4113d)
raw | patch | inline | side by side (parent: cf4113d)
author | fredboy <fredboy@protonmail.com> | |
Tue, 23 Apr 2024 02:10:52 +0000 (09:10 +0700) | ||
committer | fredboy <fredboy@protonmail.com> | |
Tue, 23 Apr 2024 03:09:49 +0000 (10:09 +0700) |
core/src/ru/deadsoftware/cavedroid/game/GameRenderer.java | patch | blob | history |
diff --git a/core/src/ru/deadsoftware/cavedroid/game/GameRenderer.java b/core/src/ru/deadsoftware/cavedroid/game/GameRenderer.java
index b54bead932f38f903a7f829cf88b5c1a60d73088..62950114bf1ac90246e108989a06d11e062b67b3 100644 (file)
Gdx.gl.glClearColor(0f, .6f, .6f, 1f);
}
+ private float mTouchDownX, mTouchDownY;
+
private void updateCameraPosition() {
Player player = mMobsController.getPlayer();
setCamPos(player.getX() + player.getWidth() / 2 - getWidth() / 2,
float touchX = transformScreenX(screenX);
float touchY = transformScreenY(screenY);
+ mTouchDownX = touchX;
+ mTouchDownY = touchY;
+
if (mMainConfig.isTouch()) {
@CheckForNull TouchButton touchedKey = getTouchedKey(touchX, touchY);
if (touchedKey != null && touchedKey.isMouse()) {
@Override
public boolean touchDragged(int screenX, int screenY, int pointer) {
+ float touchX = transformScreenX(screenX);
+ float touchY = transformScreenY(screenY);
+
+ if (Math.abs(touchX - mTouchDownX) < 16 && Math.abs(touchY - mTouchDownY) < 16) {
+ return false;
+ }
+
@CheckForNull MouseInputAction action =
mMouseInputActionMapper.mapDragged(screenX, screenY, getCameraViewport());
return handleMouseAction(action);