From fe90c002b4ce72364b2a5092e307cae607590aa7 Mon Sep 17 00:00:00 2001 From: Bart van Helvert <9639072+Bartvhelvert@users.noreply.github.com> Date: Sun, 15 Apr 2018 01:41:32 +0200 Subject: [PATCH] More accurately draw tile indicators (#1491) - Fix tile corner naming - Draw tile indicator more accurately --- .../main/java/net/runelite/api/Perspective.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/runelite-api/src/main/java/net/runelite/api/Perspective.java b/runelite-api/src/main/java/net/runelite/api/Perspective.java index 33fd8c20f7..2b244f850f 100644 --- a/runelite-api/src/main/java/net/runelite/api/Perspective.java +++ b/runelite-api/src/main/java/net/runelite/api/Perspective.java @@ -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)