From 8d48da1999d933e12ddbca262b4995e4ea323b59 Mon Sep 17 00:00:00 2001 From: Nick Thomas Date: Sat, 21 Mar 2020 11:48:29 +0000 Subject: [PATCH] Fix bounds clipping --- cmd/view-map/main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/view-map/main.go b/cmd/view-map/main.go index bf9955b..33d2f5e 100644 --- a/cmd/view-map/main.go +++ b/cmd/view-map/main.go @@ -111,9 +111,12 @@ func (e *env) Draw(screen *ebiten.Image) error { sw, sh := screen.Size() topLeft := pixToCell(e.state.origin) - topLeft.X -= 1 // Otherwise we miss half a cell on alternate rows on the left + topLeft.X -= 5 // Ensure we paint to every visible section of the screeen. + topLeft.X -= 5 // FIXME: haxxx bottomRight := pixToCell(image.Pt(e.state.origin.X+sw, e.state.origin.Y+sh)) + bottomRight.X += 5 + bottomRight.Y += 5 // X+Y is constant for all tiles in a column // X-Y is constant for all tiles in a row