From dbe2f7eefac6736067b1f4412e171ebf689d00f8 Mon Sep 17 00:00:00 2001 From: TranquillyUnpleasant <62061444+TranquillyUnpleasant@users.noreply.github.com> Date: Sun, 3 Jan 2021 23:45:35 +0500 Subject: [PATCH] Fix mirror being offset (#4248) Because apparently it isn't a valid map even though its been a known issue for months. --- core/src/mindustry/maps/filters/MirrorFilter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/mindustry/maps/filters/MirrorFilter.java b/core/src/mindustry/maps/filters/MirrorFilter.java index 3ebdb45a71..d5642381ad 100644 --- a/core/src/mindustry/maps/filters/MirrorFilter.java +++ b/core/src/mindustry/maps/filters/MirrorFilter.java @@ -68,8 +68,8 @@ public class MirrorFilter extends GenerateFilter{ void mirror(Vec2 p, float x0, float y0, float x1, float y1){ //special case: uneven map mirrored at 45 degree angle if(in.width != in.height && angle % 90 != 0){ - p.x = (p.x - in.width/2f) * -1 + in.width/2f; - p.y = (p.y - in.height/2f) * -1 + in.height/2f; + p.x = in.width - p.x - 1; + p.y = in.height - p.y - 1; }else{ float dx = x1 - x0; float dy = y1 - y0;