Combine BOTTOM_RIGHT and ABOVE_CHATBOX_RIGHT overlays for fixed mode
This commit is contained in:
@@ -207,9 +207,16 @@ public class OverlayRenderer
|
|||||||
.filter(overlay -> shouldDrawOverlay(client, overlay))
|
.filter(overlay -> shouldDrawOverlay(client, overlay))
|
||||||
.forEach(overlay ->
|
.forEach(overlay ->
|
||||||
{
|
{
|
||||||
|
OverlayPosition overlayPosition = overlay.getPosition();
|
||||||
|
if (overlayPosition == OverlayPosition.ABOVE_CHATBOX_RIGHT && !client.isResized())
|
||||||
|
{
|
||||||
|
// On fixed mode, ABOVE_CHATBOX_RIGHT is in the same location as
|
||||||
|
// BOTTOM_RIGHT. Just use BOTTOM_RIGHT to prevent overlays from
|
||||||
|
// drawing over each other.
|
||||||
|
overlayPosition = OverlayPosition.BOTTOM_RIGHT;
|
||||||
|
}
|
||||||
final Point subPosition = new Point();
|
final Point subPosition = new Point();
|
||||||
|
switch (overlayPosition)
|
||||||
switch (overlay.getPosition())
|
|
||||||
{
|
{
|
||||||
case BOTTOM_LEFT:
|
case BOTTOM_LEFT:
|
||||||
subPosition.setLocation(bottomLeftPoint);
|
subPosition.setLocation(bottomLeftPoint);
|
||||||
@@ -228,7 +235,7 @@ public class OverlayRenderer
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (overlay.getPosition().equals(OverlayPosition.DYNAMIC))
|
if (overlayPosition.equals(OverlayPosition.DYNAMIC))
|
||||||
{
|
{
|
||||||
safeRender(overlay, graphics, new Point());
|
safeRender(overlay, graphics, new Point());
|
||||||
}
|
}
|
||||||
@@ -244,7 +251,7 @@ public class OverlayRenderer
|
|||||||
|
|
||||||
final BufferedImage clippedImage = surface.getSubimage(0, 0, dimension.width, dimension.height);
|
final BufferedImage clippedImage = surface.getSubimage(0, 0, dimension.width, dimension.height);
|
||||||
|
|
||||||
switch (overlay.getPosition())
|
switch (overlayPosition)
|
||||||
{
|
{
|
||||||
case BOTTOM_LEFT:
|
case BOTTOM_LEFT:
|
||||||
bottomLeftPoint.x += dimension.width + (dimension.width == 0 ? 0 : PADDING);
|
bottomLeftPoint.x += dimension.width + (dimension.width == 0 ? 0 : PADDING);
|
||||||
@@ -263,7 +270,7 @@ public class OverlayRenderer
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
final Point transformed = OverlayUtil.transformPosition(overlay.getPosition(), dimension);
|
final Point transformed = OverlayUtil.transformPosition(overlayPosition, dimension);
|
||||||
graphics.drawImage(clippedImage, subPosition.x + transformed.x, subPosition.y + transformed.y, null);
|
graphics.drawImage(clippedImage, subPosition.x + transformed.x, subPosition.y + transformed.y, null);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user