Browse Source

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

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

+ 1
- 1
modules/juce_gui_basics/layout/juce_ComponentBoundsConstrainer.cpp 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();


Loading…
Cancel
Save