Fixed #9572
This commit is contained in:
@@ -148,17 +148,20 @@ public class MinimapRenderer{
|
|||||||
|
|
||||||
Tmp.m2.set(Draw.trans());
|
Tmp.m2.set(Draw.trans());
|
||||||
|
|
||||||
|
float scaleFactor;
|
||||||
var trans = Tmp.m1.idt();
|
var trans = Tmp.m1.idt();
|
||||||
trans.translate(lastX, lastY);
|
trans.translate(lastX, lastY);
|
||||||
if(!worldSpace){
|
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);
|
trans.translate(-rect.x, -rect.y);
|
||||||
}else{
|
}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);
|
trans.translate(tilesize / 2f, tilesize / 2f);
|
||||||
Draw.trans(trans);
|
Draw.trans(trans);
|
||||||
|
|
||||||
|
scaleFactor = 1f / scaleFactor;
|
||||||
|
|
||||||
for(Unit unit : units){
|
for(Unit unit : units){
|
||||||
if(unit.inFogTo(player.team()) || !unit.type.drawMinimap) continue;
|
if(unit.inFogTo(player.team()) || !unit.type.drawMinimap) continue;
|
||||||
|
|
||||||
@@ -198,7 +201,7 @@ public class MinimapRenderer{
|
|||||||
dynamicTex.setFilter(TextureFilter.nearest);
|
dynamicTex.setFilter(TextureFilter.nearest);
|
||||||
|
|
||||||
Tmp.tr1.set(dynamicTex);
|
Tmp.tr1.set(dynamicTex);
|
||||||
Tmp.tr1.set(0f, 0f, 1f, 1f);
|
Tmp.tr1.set(0f, 1f, 1f, 0f);
|
||||||
|
|
||||||
float wf = world.width() * tilesize;
|
float wf = world.width() * tilesize;
|
||||||
float hf = world.height() * tilesize;
|
float hf = world.height() * tilesize;
|
||||||
@@ -226,7 +229,7 @@ public class MinimapRenderer{
|
|||||||
if(!mobile){
|
if(!mobile){
|
||||||
//draw bounds for camera - not drawn on mobile because you can't shift it by tapping anyway
|
//draw bounds for camera - not drawn on mobile because you can't shift it by tapping anyway
|
||||||
Rect r = Core.camera.bounds(Tmp.r1);
|
Rect r = Core.camera.bounds(Tmp.r1);
|
||||||
Lines.stroke(Scl.scl(3f));
|
Lines.stroke(Scl.scl(3f) * scaleFactor);
|
||||||
Draw.color(Pal.accent);
|
Draw.color(Pal.accent);
|
||||||
Lines.rect(r.x, r.y, r.width, r.height);
|
Lines.rect(r.x, r.y, r.width, r.height);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
|
|||||||
Reference in New Issue
Block a user