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

Fixed a bug in ComponentBoundsConstrainer::setBoundsForComponent() where a component positioned off-screen or on another monitor wouldn't have its bounds set correctly

This commit is contained in:
ed 2017-06-05 14:12:44 +01:00
parent 6f94997adb
commit c56dc32b28

View file

@ -114,7 +114,7 @@ void ComponentBoundsConstrainer::setBoundsForComponent (Component* component,
if (auto* peer = component->getPeer())
border = peer->getFrameSize();
auto targetScreenArea = component->localAreaToGlobal (targetBounds.withZeroOrigin());
auto targetScreenArea = component->localAreaToGlobal (targetBounds);
auto screenBounds = Desktop::getInstance().getDisplays().getDisplayContaining (targetScreenArea.getCentre()).userArea;
limits = component->getLocalArea (nullptr, screenBounds) + component->getPosition();