From fac4cafcf02418e42f4ada37f88aeadcbe918481 Mon Sep 17 00:00:00 2001 From: illumineawake Date: Thu, 21 May 2020 18:15:30 +1000 Subject: [PATCH] worldarea: allow WorldArea to take 2 WorldPoints and calculate width and height --- .../src/main/java/net/runelite/api/coords/WorldArea.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/runelite-api/src/main/java/net/runelite/api/coords/WorldArea.java b/runelite-api/src/main/java/net/runelite/api/coords/WorldArea.java index 7a12a730fd..3e34427459 100644 --- a/runelite-api/src/main/java/net/runelite/api/coords/WorldArea.java +++ b/runelite-api/src/main/java/net/runelite/api/coords/WorldArea.java @@ -88,6 +88,15 @@ public class WorldArea this.height = height; } + public WorldArea(WorldPoint swLocation, WorldPoint neLocation) + { + this.x = swLocation.getX(); + this.y = swLocation.getY(); + this.plane = swLocation.getPlane(); + this.width = neLocation.getX() - swLocation.getX(); + this.height = neLocation.getY() - swLocation.getY(); + } + /** * Computes the shortest distance to another area. *