1
0
Fork 0
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:
jules 2013-11-11 14:26:31 +00:00
parent a90c0635bc
commit a228a3859b

View file

@ -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());