overlay: do not move snap points backwards

because WidgetOverlays in their default position render in the vanilla
position it can cause other overlays to occlude previous overlays when
they should not
This commit is contained in:
Max Weber
2022-05-15 18:31:05 -06:00
committed by Adam
parent 6b81e0c7d1
commit 1ed37f561d

View File

@@ -213,19 +213,19 @@ public class OverlayUtil
switch (overlayPosition)
{
case BOTTOM_LEFT:
sX = bounds.x + bounds.width + padding;
sX = Math.max(sX, bounds.x + bounds.width + padding);
break;
case BOTTOM_RIGHT:
sX = bounds.x - padding;
sX = Math.min(sX, bounds.x - padding);
break;
case TOP_LEFT:
case TOP_CENTER:
case CANVAS_TOP_RIGHT:
case TOP_RIGHT:
sY = bounds.y + bounds.height + padding;
sY = Math.max(sY, bounds.y + bounds.height + padding);
break;
case ABOVE_CHATBOX_RIGHT:
sY = bounds.y - padding;
sY = Math.min(sY, bounds.y - padding);
break;
default:
throw new IllegalArgumentException();