1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Projucer: Avoid hitting an assertion when keeping windows onscreen

This commit is contained in:
ed 2020-01-16 12:39:18 +00:00
parent 80d819ccf2
commit 664e08f796

View file

@ -809,8 +809,8 @@ void MainWindowList::checkWindowBounds (MainWindow& windowToCheck)
if (auto* peer = windowToCheck.getPeer())
peer->getFrameSize().subtractFrom (screenLimits);
auto constrainedX = jlimit (screenLimits.getX(), screenLimits.getRight() - windowBounds.getWidth(), windowBounds.getX());
auto constrainedY = jlimit (screenLimits.getY(), screenLimits.getBottom() - windowBounds.getHeight(), windowBounds.getY());
auto constrainedX = jlimit (screenLimits.getX(), jmax (screenLimits.getX(), screenLimits.getRight() - windowBounds.getWidth()), windowBounds.getX());
auto constrainedY = jlimit (screenLimits.getY(), jmax (screenLimits.getY(), screenLimits.getBottom() - windowBounds.getHeight()), windowBounds.getY());
Point<int> constrainedTopLeft (constrainedX, constrainedY);