Fixed drawItemSelection squishing things

This commit is contained in:
Anuken
2025-07-03 21:23:02 -04:00
parent 835c8b4a6c
commit dd289d3d08
3 changed files with 12 additions and 4 deletions

View File

@@ -1215,11 +1215,11 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
public void drawItemSelection(@Nullable UnlockableContent selection){
if(selection != null){
float dx = x - block.size * tilesize/2f, dy = y + block.size * tilesize/2f, s = iconSmall / 4f;
float dx = x - block.size * tilesize/2f, dy = y + block.size * tilesize/2f, s = iconSmall / 4f * selection.fullIcon.ratio(), h = iconSmall / 4f;
Draw.mixcol(Color.darkGray, 1f);
Draw.rect(selection.fullIcon, dx, dy - 1, s, s);
Draw.rect(selection.fullIcon, dx, dy - 1, s, h);
Draw.reset();
Draw.rect(selection.fullIcon, dx, dy, s, s);
Draw.rect(selection.fullIcon, dx, dy, s, h);
}
}

View File

@@ -220,6 +220,14 @@ public class UnitFactory extends UnitBlock{
}
}
@Override
public void drawSelect(){
super.drawSelect();
if(plans.size > 1 && currentPlan != -1 && currentPlan < plans.size){
drawItemSelection(plans.get(currentPlan).unit);
}
}
@Override
public Vec2 getCommandPosition(){
return commandPos;