Incorporate height into the GroundItems overlay
This commit is contained in:
@@ -26,6 +26,8 @@ package net.runelite.api;
|
||||
|
||||
public interface ItemLayer extends TileObject
|
||||
{
|
||||
int getHeight();
|
||||
|
||||
Renderable getBottom();
|
||||
|
||||
Renderable getMiddle();
|
||||
|
||||
@@ -45,6 +45,8 @@ public interface TileObject
|
||||
|
||||
Point getCanvasLocation();
|
||||
|
||||
Point getCanvasLocation(int zOffset);
|
||||
|
||||
Polygon getCanvasTilePoly();
|
||||
|
||||
Point getCanvasTextLocation(Graphics2D graphics, String text, int zOffset);
|
||||
|
||||
@@ -228,7 +228,7 @@ public class GroundItemsOverlay extends Overlay
|
||||
|
||||
for (int i = 0; i < itemIds.size(); ++i)
|
||||
{
|
||||
Point point = itemLayer.getCanvasLocation();
|
||||
Point point = itemLayer.getCanvasLocation(itemLayer.getHeight());
|
||||
// if the item is offscreen, don't bother drawing it
|
||||
if (point == null || (viewport != null && !viewport.contains(point)))
|
||||
{
|
||||
|
||||
@@ -85,16 +85,23 @@ public abstract class TileObjectMixin implements TileObject
|
||||
@Inject
|
||||
public Point getRegionLocation()
|
||||
{
|
||||
Point locaLocation = getLocalLocation();
|
||||
return new Point(locaLocation.getX() >>> LOCAL_COORD_BITS, locaLocation.getY() >>> LOCAL_COORD_BITS);
|
||||
Point localLocation = getLocalLocation();
|
||||
return new Point(localLocation.getX() >>> LOCAL_COORD_BITS, localLocation.getY() >>> LOCAL_COORD_BITS);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Inject
|
||||
public Point getCanvasLocation()
|
||||
{
|
||||
Point locaLocation = getLocalLocation();
|
||||
return Perspective.worldToCanvas(client, locaLocation.getX(), locaLocation.getY(), 0);
|
||||
return getCanvasLocation(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Inject
|
||||
public Point getCanvasLocation(int zOffset)
|
||||
{
|
||||
Point localLocation = getLocalLocation();
|
||||
return Perspective.worldToCanvas(client, localLocation.getX(), localLocation.getY(), 0, zOffset);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user