overlay renderer: account for parent's position when clamping location
This commit is contained in:
@@ -949,9 +949,9 @@ public class OverlayRenderer extends MouseAdapter implements KeyListener
|
|||||||
// Constrain overlay position to be within the parent bounds
|
// Constrain overlay position to be within the parent bounds
|
||||||
return new Point(
|
return new Point(
|
||||||
Ints.constrainToRange(overlayX, parentBounds.x,
|
Ints.constrainToRange(overlayX, parentBounds.x,
|
||||||
Math.max(parentBounds.x, parentBounds.width - overlayWidth)),
|
Math.max(parentBounds.x, parentBounds.x + parentBounds.width - overlayWidth)),
|
||||||
Ints.constrainToRange(overlayY, parentBounds.y,
|
Ints.constrainToRange(overlayY, parentBounds.y,
|
||||||
Math.max(parentBounds.y, parentBounds.height - overlayHeight))
|
Math.max(parentBounds.y, parentBounds.y + parentBounds.height - overlayHeight))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user