Skip to content

Commit 1aedd13

Browse files
committed
tank circle visualisation more centered
1 parent 4c08e10 commit 1aedd13

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/main/java/dev/zwazel/internal/debug/MapVisualiser.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,15 +190,16 @@ private void drawTank(Graphics2D g2d, PublicGameWorld world) {
190190
);
191191

192192
// Turn the position from float to int, so it can be drawn. from units to pixels
193-
int x = (int) (myPosition.getX() * CELL_SIZE);
194-
int y = (int) (myPosition.getZ() * CELL_SIZE);
193+
int ovaLSize = 15;
194+
int x = (int) (myPosition.getX() * CELL_SIZE) - ovaLSize / 2;
195+
int y = (int) (myPosition.getZ() * CELL_SIZE) - ovaLSize / 2;
195196

196197
g2d.setColor(Color.ORANGE);
197198
g2d.fillOval(
198199
x,
199200
y,
200-
15,
201-
15
201+
ovaLSize,
202+
ovaLSize
202203
);
203204
}
204205

0 commit comments

Comments
 (0)