Fix map square coordinate text

Signed-off-by: Graham <gpe@openrs2.org>
bzip2
Graham 4 years ago
parent 7d041e6e22
commit 09961589e3
  1. 8
      archive/src/main/kotlin/org/openrs2/archive/map/MapRenderer.kt

@ -236,8 +236,9 @@ public class MapRenderer @Inject constructor(
for (z in z0..z1) { for (z in z0..z1) {
val mapSquare = getMapSquare(x, z) val mapSquare = getMapSquare(x, z)
val state = states[mapSquare] ?: continue val state = states[mapSquare] ?: continue
val label = "${x}_$z"
renderStateOverlay(image, graphics, x - x0, z - z0, state) renderStateOverlay(image, graphics, x - x0, z - z0, state, label)
} }
} }
@ -375,7 +376,8 @@ public class MapRenderer @Inject constructor(
graphics: Graphics2D, graphics: Graphics2D,
mapX: Int, mapX: Int,
mapZ: Int, mapZ: Int,
state: MapSquareState state: MapSquareState,
label: String
) { ) {
val x = mapX * MAP_SIZE val x = mapX * MAP_SIZE
val y = image.height - (mapZ + 1) * MAP_SIZE val y = image.height - (mapZ + 1) * MAP_SIZE
@ -398,8 +400,6 @@ public class MapRenderer @Inject constructor(
MAP_SIZE - 1 MAP_SIZE - 1
) )
val label = "${mapX}_$mapZ"
val labelWidth = graphics.fontMetrics.stringWidth(label) val labelWidth = graphics.fontMetrics.stringWidth(label)
val labelHeight = graphics.fontMetrics.height val labelHeight = graphics.fontMetrics.height
val labelAscent = graphics.fontMetrics.ascent val labelAscent = graphics.fontMetrics.ascent

Loading…
Cancel
Save