Fix bounds clipping

This commit is contained in:
2020-03-21 11:48:29 +00:00
parent 8b02f534f1
commit 8d48da1999

View File

@@ -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