mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Fix for ComponentMovementWatcher with top-level windows.
This commit is contained in:
parent
a90c0635bc
commit
a228a3859b
1 changed files with 9 additions and 3 deletions
|
|
@ -79,10 +79,16 @@ void ComponentMovementWatcher::componentMovedOrResized (Component&, bool wasMove
|
|||
{
|
||||
if (wasMoved)
|
||||
{
|
||||
const Point<int> pos (component->getTopLevelComponent()->getLocalPoint (component, Point<int>()));
|
||||
Point<int> newPos;
|
||||
Component* const top = component->getTopLevelComponent();
|
||||
|
||||
wasMoved = lastBounds.getPosition() != pos;
|
||||
lastBounds.setPosition (pos);
|
||||
if (top != component)
|
||||
newPos = top->getLocalPoint (component, Point<int>());
|
||||
else
|
||||
newPos = top->getPosition();
|
||||
|
||||
wasMoved = lastBounds.getPosition() != newPos;
|
||||
lastBounds.setPosition (newPos);
|
||||
}
|
||||
|
||||
wasResized = (lastBounds.getWidth() != component->getWidth() || lastBounds.getHeight() != component->getHeight());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue