@@ 97,6 97,8 @@ func drawHud(screen *ebiten.Image, sys []System) {
const cellW = 12
const cellH = 10
const cellGap = 2
+ // cellBottom is the y of the bottom-most cell's top edge; loop-invariant.
+ const cellBottom = VirtualH - cellGap
outline := color.RGBA{255, 255, 255, 255}
// Role labels in display order (index == int(RoomRole)).
@@ 112,9 114,6 @@ func drawHud(screen *ebiten.Image, sys []System) {
// Cells stacked bottom-up. Row 0 is at the bottom of the HUD strip.
for j := 0; j < s.MaxLevel; j++ {
- // Compute y so that row 0 is at the bottom. We allocate space
- // starting below the label (label height ~12px).
- cellBottom := HudY + (VirtualH - HudY) - cellGap
cy := cellBottom - (j+1)*(cellH+cellGap)
cx := colLeft + 4