From f61f3af687dfcaa27435a6f966bd5fcfcaf7fe8d Mon Sep 17 00:00:00 2001 From: Anuken Date: Fri, 4 Jan 2019 11:39:49 -0500 Subject: [PATCH 1/3] Zoom fixes --- core/src/io/anuke/mindustry/core/Renderer.java | 2 +- core/src/io/anuke/mindustry/input/MobileInput.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/io/anuke/mindustry/core/Renderer.java b/core/src/io/anuke/mindustry/core/Renderer.java index 756ed9945c..cff7944281 100644 --- a/core/src/io/anuke/mindustry/core/Renderer.java +++ b/core/src/io/anuke/mindustry/core/Renderer.java @@ -297,7 +297,7 @@ public class Renderer implements ApplicationListener{ public void clampScale(){ float s = io.anuke.arc.scene.ui.layout.Unit.dp.scl(1f); - targetscale = Mathf.clamp(targetscale, Math.round(s * 1), Math.round(s * 6)); + targetscale = Mathf.clamp(targetscale, s * 2.5f, Math.round(s * 7)); } public void takeMapScreenshot(){ diff --git a/core/src/io/anuke/mindustry/input/MobileInput.java b/core/src/io/anuke/mindustry/input/MobileInput.java index b8fc6c00cd..a1d95f6b46 100644 --- a/core/src/io/anuke/mindustry/input/MobileInput.java +++ b/core/src/io/anuke/mindustry/input/MobileInput.java @@ -691,7 +691,7 @@ public class MobileInput extends InputHandler implements GestureListener{ @Override public boolean zoom(float initialDistance, float distance){ - float amount = (distance > initialDistance ? 0.1f : -0.1f) * Time.delta(); + float amount = (distance > initialDistance ? 0.1f : -0.1f); renderer.scaleCamera(io.anuke.arc.scene.ui.layout.Unit.dp.scl(amount)); return true; } From 3b41ded04502acf1182b6d822faf342b72b8c8e5 Mon Sep 17 00:00:00 2001 From: Anuken Date: Fri, 4 Jan 2019 12:18:26 -0500 Subject: [PATCH 2/3] More zoom fixes --- core/src/io/anuke/mindustry/input/MobileInput.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/src/io/anuke/mindustry/input/MobileInput.java b/core/src/io/anuke/mindustry/input/MobileInput.java index a1d95f6b46..4ac8d2f761 100644 --- a/core/src/io/anuke/mindustry/input/MobileInput.java +++ b/core/src/io/anuke/mindustry/input/MobileInput.java @@ -47,6 +47,7 @@ public class MobileInput extends InputHandler implements GestureListener{ //gesture data private Vector2 vector = new Vector2(); + private float lastDistance = -1f; private boolean canPan; /** Set of completed guides. */ private ObjectSet guides = new ObjectSet<>(); @@ -691,8 +692,11 @@ public class MobileInput extends InputHandler implements GestureListener{ @Override public boolean zoom(float initialDistance, float distance){ - float amount = (distance > initialDistance ? 0.1f : -0.1f); + if(lastDistance == -1) lastDistance = initialDistance; + + float amount = (distance > lastDistance ? 0.07f : -0.07f) * Time.delta(); renderer.scaleCamera(io.anuke.arc.scene.ui.layout.Unit.dp.scl(amount)); + lastDistance = distance; return true; } From d5626bfe526b56ca14a30b9373bf4bdb3327212f Mon Sep 17 00:00:00 2001 From: Anuken Date: Fri, 4 Jan 2019 15:12:34 -0500 Subject: [PATCH 3/3] Updated to next version of kryonet --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 88ff2ba2c4..f4ff0f9303 100644 --- a/build.gradle +++ b/build.gradle @@ -251,7 +251,7 @@ project(":net"){ dependencies{ compile project(":core") compile "org.lz4:lz4-java:1.4.1" - compile 'com.github.Anuken:kryonet:38ca8d51b5763ebe463ed973a63b64390ff51416' + compile 'com.github.Anuken:kryonet:a64d2280880e80566ca1bdaffa55de43e51cad38' compile 'com.github.Anuken:WaifUPnP:05eb46bc577fd7674596946ba288c96c0cedd893' } }