Browse Source

Fixed a bug in ComponentBoundsConstrainer that caused JUCE windows to be snapped to the wrong position when using multiple displays

tags/2021-05-28
ed 8 years ago
parent
commit
cfdb747a42
1 changed files with 1 additions and 2 deletions
  1. +1
    -2
      modules/juce_gui_basics/layout/juce_ComponentBoundsConstrainer.cpp

+ 1
- 2
modules/juce_gui_basics/layout/juce_ComponentBoundsConstrainer.cpp View File

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


Loading…
Cancel
Save