From c56dc32b28f44cf68a256c783c06d09870eadbea Mon Sep 17 00:00:00 2001 From: ed Date: Mon, 5 Jun 2017 14:12:44 +0100 Subject: [PATCH] Fixed a bug in ComponentBoundsConstrainer::setBoundsForComponent() where a component positioned off-screen or on another monitor wouldn't have its bounds set correctly --- .../juce_gui_basics/layout/juce_ComponentBoundsConstrainer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/juce_gui_basics/layout/juce_ComponentBoundsConstrainer.cpp b/modules/juce_gui_basics/layout/juce_ComponentBoundsConstrainer.cpp index 6d9d7fc5d1..e824cb9bb9 100644 --- a/modules/juce_gui_basics/layout/juce_ComponentBoundsConstrainer.cpp +++ b/modules/juce_gui_basics/layout/juce_ComponentBoundsConstrainer.cpp @@ -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();