More accurately draw tiles to canvas

Fixes a problem where the coordinates of the bottom right and bottom left corner of a canvas tile would lie on the neighbouring tiles.
This commit is contained in:
Bart van Helvert
2018-03-08 01:40:15 +01:00
parent 23c448ccd0
commit 92588c8868

View File

@@ -349,8 +349,8 @@ public class Perspective
Point topLeft = new Point(localLocation.getX() - (aoeSize * LOCAL_TILE_SIZE) - halfTile,
localLocation.getY() - (aoeSize * LOCAL_TILE_SIZE) - halfTile);
// expand by size
Point bottomRight = new Point(topLeft.getX() + size * LOCAL_TILE_SIZE,
topLeft.getY() + size * LOCAL_TILE_SIZE);
Point bottomRight = new Point(topLeft.getX() + size * LOCAL_TILE_SIZE - 1,
topLeft.getY() + size * LOCAL_TILE_SIZE - 1);
// Take the x of top left and the y of bottom right to create bottom left
Point bottomLeft = new Point(topLeft.getX(), bottomRight.getY());
// Similarly for top right