Skip to content

Commit

Permalink
Correctly centre map lables
Browse files Browse the repository at this point in the history
  • Loading branch information
cwisniew committed Mar 10, 2024
1 parent 3581ce7 commit 65590bf
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1220,7 +1220,9 @@ private void renderLabels(Graphics2D g, PlayerView view) {
timer.start("labels-1.1");
ScreenPoint sp = ScreenPoint.fromZonePointRnd(this, zp.x, zp.y);
var dim = flabel.getDimensions(g, label.getLabel());
Rectangle bounds = flabel.render(g, (int) sp.x, (int) sp.y, label.getLabel());
Rectangle bounds =
flabel.render(
g, (int) (sp.x - dim.width / 2), (int) (sp.y - dim.height / 2), label.getLabel());
labelLocationList.add(new LabelLocation(bounds, label));
timer.stop("labels-1.1");
}
Expand Down

0 comments on commit 65590bf

Please sign in to comment.