From 83b3bd9a2e55eb87359256ebe861ea3b403eceb2 Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 20 Oct 2019 20:39:58 -0400 Subject: [PATCH] Fixed flip not taking into account offset --- core/src/io/anuke/mindustry/input/InputHandler.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/src/io/anuke/mindustry/input/InputHandler.java b/core/src/io/anuke/mindustry/input/InputHandler.java index a7b1eda091..72a5f1a4cc 100644 --- a/core/src/io/anuke/mindustry/input/InputHandler.java +++ b/core/src/io/anuke/mindustry/input/InputHandler.java @@ -262,15 +262,15 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ } public void flipRequests(Array requests, boolean x){ - int origin = x ? rawTileX() : rawTileY(); + int origin = (x ? rawTileX() : rawTileY()) * tilesize; requests.each(req -> { - int value = -((x ? req.x : req.y) - origin) + origin; + float value = -((x ? req.x : req.y) * tilesize - origin + req.block.offset()) + origin; if(x){ - req.x = value; + req.x = (int)((value - req.block.offset()) / tilesize); }else{ - req.y = value; + req.y = (int)((value - req.block.offset()) / tilesize); } if(req.block.posConfig){