From ac4d57013df9651c53a6a038d66841482738cb46 Mon Sep 17 00:00:00 2001 From: Anuken Date: Mon, 19 Feb 2024 10:05:58 -0500 Subject: [PATCH] Fixed #9572 --- core/src/mindustry/graphics/MinimapRenderer.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/core/src/mindustry/graphics/MinimapRenderer.java b/core/src/mindustry/graphics/MinimapRenderer.java index cd0362ff62..78d57bebea 100644 --- a/core/src/mindustry/graphics/MinimapRenderer.java +++ b/core/src/mindustry/graphics/MinimapRenderer.java @@ -148,17 +148,20 @@ public class MinimapRenderer{ Tmp.m2.set(Draw.trans()); + float scaleFactor; var trans = Tmp.m1.idt(); trans.translate(lastX, lastY); if(!worldSpace){ - trans.scl(Tmp.v1.set(lastW / rect.width, lastH / rect.height)); + trans.scl(Tmp.v1.set(scaleFactor = lastW / rect.width, lastH / rect.height)); trans.translate(-rect.x, -rect.y); }else{ - trans.scl(Tmp.v1.set(lastW / world.unitWidth(), lastH / world.unitHeight())); + trans.scl(Tmp.v1.set(scaleFactor = lastW / world.unitWidth(), lastH / world.unitHeight())); } trans.translate(tilesize / 2f, tilesize / 2f); Draw.trans(trans); + scaleFactor = 1f / scaleFactor; + for(Unit unit : units){ if(unit.inFogTo(player.team()) || !unit.type.drawMinimap) continue; @@ -198,7 +201,7 @@ public class MinimapRenderer{ dynamicTex.setFilter(TextureFilter.nearest); Tmp.tr1.set(dynamicTex); - Tmp.tr1.set(0f, 0f, 1f, 1f); + Tmp.tr1.set(0f, 1f, 1f, 0f); float wf = world.width() * tilesize; float hf = world.height() * tilesize; @@ -226,7 +229,7 @@ public class MinimapRenderer{ if(!mobile){ //draw bounds for camera - not drawn on mobile because you can't shift it by tapping anyway Rect r = Core.camera.bounds(Tmp.r1); - Lines.stroke(Scl.scl(3f)); + Lines.stroke(Scl.scl(3f) * scaleFactor); Draw.color(Pal.accent); Lines.rect(r.x, r.y, r.width, r.height); Draw.reset();