diff --git a/modules/juce_gui_basics/misc/juce_DropShadower.cpp b/modules/juce_gui_basics/misc/juce_DropShadower.cpp index 8a779513c3..071efc8fbd 100644 --- a/modules/juce_gui_basics/misc/juce_DropShadower.cpp +++ b/modules/juce_gui_basics/misc/juce_DropShadower.cpp @@ -175,7 +175,7 @@ void DropShadower::updateShadows() const int w = owner->getWidth(); const int h = owner->getHeight() + shadowEdge + shadowEdge; - for (int i = shadowWindows.size(); --i >= 0;) + for (int i = 4; --i >= 0;) { // there seem to be rare situations where the dropshadower may be deleted by // callbacks during this loop, so use a weak ref to watch out for this.. @@ -197,7 +197,7 @@ void DropShadower::updateShadows() } if (sw != nullptr) - sw->toBehind (owner); + sw->toBehind (i == 3 ? owner : shadowWindows.getUnchecked (i + 1)); if (sw == nullptr) return;