More accurately draw tile indicators (#1491)

- Fix tile corner naming
- Draw tile indicator more accurately
This commit is contained in:
Bart van Helvert
2018-04-15 01:41:32 +02:00
committed by Tomas Slusny
parent 8207d89468
commit fe90c002b4

View File

@@ -289,19 +289,19 @@ public class Perspective
int aoeSize = size / 2;
// Shift over one half tile as localLocation is the center point of the tile, and then shift the area size
Point topLeft = new Point(localLocation.getX() - (aoeSize * LOCAL_TILE_SIZE) - halfTile,
localLocation.getY() - (aoeSize * LOCAL_TILE_SIZE) - halfTile);
Point southWestCorner = new Point(localLocation.getX() - (aoeSize * LOCAL_TILE_SIZE) - halfTile + 1,
localLocation.getY() - (aoeSize * LOCAL_TILE_SIZE) - halfTile + 1);
// expand by size
Point bottomRight = new Point(topLeft.getX() + size * LOCAL_TILE_SIZE - 1,
topLeft.getY() + size * LOCAL_TILE_SIZE - 1);
Point northEastCorner = new Point(southWestCorner.getX() + size * LOCAL_TILE_SIZE - 1,
southWestCorner.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());
Point bottomLeft = new Point(southWestCorner.getX(), northEastCorner.getY());
// Similarly for top right
Point topRight = new Point(bottomRight.getX(), topLeft.getY());
Point topRight = new Point(northEastCorner.getX(), southWestCorner.getY());
Point p1 = worldToCanvas(client, topLeft.getX(), topLeft.getY(), plane);
Point p1 = worldToCanvas(client, southWestCorner.getX(), southWestCorner.getY(), plane);
Point p2 = worldToCanvas(client, topRight.getX(), topRight.getY(), plane);
Point p3 = worldToCanvas(client, bottomRight.getX(), bottomRight.getY(), plane);
Point p3 = worldToCanvas(client, northEastCorner.getX(), northEastCorner.getY(), plane);
Point p4 = worldToCanvas(client, bottomLeft.getX(), bottomLeft.getY(), plane);
if (p1 == null || p2 == null || p3 == null || p4 == null)