clue scroll overlay: Show visible emote widget area
The visible area of emote widgets will now be highlighted, regardless of whether the widget is partially outside the emote window.  Fixes runelite/runelite#4163
This commit is contained in:
@@ -122,13 +122,21 @@ public class ClueScrollEmoteOverlay extends Overlay
|
|||||||
// Don't draw outside the emotes window
|
// Don't draw outside the emotes window
|
||||||
net.runelite.api.Point windowLocation = window.getCanvasLocation();
|
net.runelite.api.Point windowLocation = window.getCanvasLocation();
|
||||||
|
|
||||||
if (windowLocation.getY() > canvasLocation.getY()
|
if (windowLocation.getY() > canvasLocation.getY() + widget.getHeight()
|
||||||
|| windowLocation.getY() + window.getHeight() < canvasLocation.getY() + widget.getHeight())
|
|| windowLocation.getY() + window.getHeight() < canvasLocation.getY())
|
||||||
{
|
{
|
||||||
return;
|
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(),
|
OverlayUtil.renderHoverableArea(graphics, widgetArea, client.getMouseCanvasPosition(),
|
||||||
HIGHLIGHT_FILL_COLOR, HIGHLIGHT_BORDER_COLOR, HIGHLIGHT_HOVER_BORDER_COLOR);
|
HIGHLIGHT_FILL_COLOR, HIGHLIGHT_BORDER_COLOR, HIGHLIGHT_HOVER_BORDER_COLOR);
|
||||||
|
|||||||
Reference in New Issue
Block a user