overlay renderer: add check for chatbox being minimized

This commit is contained in:
Seth
2018-01-15 08:30:51 -06:00
committed by Adam
parent c483ba0aa5
commit 9fed1187f5

View File

@@ -197,7 +197,7 @@ public class OverlayRenderer
? new Rectangle(viewport.getBounds())
: new Rectangle(0, 0, surface.getWidth(), surface.getHeight());
final Widget chatbox = client.getWidget(WidgetInfo.CHATBOX);
final Widget chatbox = client.getWidget(WidgetInfo.CHATBOX_MESSAGES);
final Rectangle chatboxBounds = chatbox != null
? chatbox.getBounds() : new Rectangle(0, bounds.height, 519, 165);
@@ -213,6 +213,13 @@ public class OverlayRenderer
final Point rightChatboxPoint = new Point();
rightChatboxPoint.move(bounds.x + chatboxBounds.width - BORDER_RIGHT,bounds.y + bounds.height - BORDER_BOTTOM);
//check to see if Chatbox is minimized
if (chatbox != null && client.isResized() && chatbox.isHidden())
{
rightChatboxPoint.y += chatboxBounds.height;
bottomLeftPoint.y += chatboxBounds.height;
}
overlays.stream()
.filter(overlay -> overlay.getLayer() == layer)
.forEach(overlay ->