Fix bounds clipping
This commit is contained in:
@@ -111,9 +111,12 @@ func (e *env) Draw(screen *ebiten.Image) error {
|
|||||||
sw, sh := screen.Size()
|
sw, sh := screen.Size()
|
||||||
|
|
||||||
topLeft := pixToCell(e.state.origin)
|
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 := 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 column
|
||||||
// X-Y is constant for all tiles in a row
|
// X-Y is constant for all tiles in a row
|
||||||
|
Reference in New Issue
Block a user