Merge pull request #5499 from Nightfirecat/fix-emote-clue-emote-overlay

clue scroll overlay: Show visible emote widget area
This commit is contained in:
Tomas Slusny
2018-09-17 11:14:52 +02:00
committed by GitHub

View File

@@ -122,13 +122,21 @@ public class ClueScrollEmoteOverlay extends Overlay
// Don't draw outside the emotes window
net.runelite.api.Point windowLocation = window.getCanvasLocation();
if (windowLocation.getY() > canvasLocation.getY()
|| windowLocation.getY() + window.getHeight() < canvasLocation.getY() + widget.getHeight())
if (windowLocation.getY() > canvasLocation.getY() + widget.getHeight()
|| windowLocation.getY() + window.getHeight() < canvasLocation.getY())
{
return;
}
Area widgetArea = new Area(new Rectangle(canvasLocation.getX(), canvasLocation.getY(), widget.getWidth(), widget.getHeight()));
// Visible area of emote widget
Area widgetArea = new Area(
new Rectangle(
canvasLocation.getX(),
Math.max(canvasLocation.getY(), windowLocation.getY()),
widget.getWidth(),
Math.min(
Math.min(windowLocation.getY() + window.getHeight() - canvasLocation.getY(), widget.getHeight()),
Math.min(canvasLocation.getY() + widget.getHeight() - windowLocation.getY(), widget.getHeight()))));
OverlayUtil.renderHoverableArea(graphics, widgetArea, client.getMouseCanvasPosition(),
HIGHLIGHT_FILL_COLOR, HIGHLIGHT_BORDER_COLOR, HIGHLIGHT_HOVER_BORDER_COLOR);