Skip to content

Commit

Permalink
when height 1-9 add space to center in hex
Browse files Browse the repository at this point in the history
  • Loading branch information
kuronekochomusuke committed Feb 10, 2023
1 parent a1bf1a0 commit e443451
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions megamek/src/megamek/client/ui/swing/minimap/Minimap.java
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,6 @@ private void drawButtons(Graphics g) {
g.setColor(Color.green.darker());
g.drawLine(x, y0, x, h);
}

}
}

Expand All @@ -743,10 +742,11 @@ private void paintHeight(Graphics g, Hex h, int x, int y) {
height = (h.containsAnyTerrainOf(BUILDING, FUEL_TANK)) ? h.ceiling() : h.floor();
}
if (height != 0) {
String sHeight = ((height > -1) && (height < 10)) ? " " + height : height + "";
int baseX = (x * (HEX_SIDE[zoom] + HEX_SIDE_BY_SIN30[zoom])) + leftMargin;
int baseY = (((2 * y) + 1 + (x % 2)) * HEX_SIDE_BY_COS30[zoom]) + topMargin;
g.setColor(Color.white);
g.drawString(height + "", baseX + 5, baseY + 5);
g.drawString(sHeight, baseX + 5, baseY + 5);
}
}

Expand Down

0 comments on commit e443451

Please sign in to comment.