diff --git a/juce_amalgamated.cpp b/juce_amalgamated.cpp index 45f33776f3..23ce041c7b 100644 --- a/juce_amalgamated.cpp +++ b/juce_amalgamated.cpp @@ -80006,19 +80006,19 @@ void DrawableComposite::bringToFront (const int index) void DrawableComposite::render (const Drawable::RenderingContext& context) const { - if (drawables.size() > 1) + if (drawables.size() > 0 && context.opacity > 0) { - Drawable::RenderingContext contextCopy (context); - - if (context.opacity >= 1.0f) + if (context.opacity >= 1.0f || drawables.size() == 1) { + Drawable::RenderingContext contextCopy (context); + for (int i = 0; i < drawables.size(); ++i) { const AffineTransform* const t = transforms.getUnchecked(i); contextCopy.transform = (t == 0) ? context.transform : t->followedBy (context.transform); - drawables.getUnchecked(i)->render (context); + drawables.getUnchecked(i)->render (contextCopy); } } else @@ -80040,10 +80040,6 @@ void DrawableComposite::render (const Drawable::RenderingContext& context) const context.g.drawImageAt (&tempImage, clipBounds.getX(), clipBounds.getY()); } } - else if (drawables.size() > 0) - { - drawables.getUnchecked(0)->render (context); - } } void DrawableComposite::getBounds (float& x, float& y, float& width, float& height) const diff --git a/src/gui/graphics/drawables/juce_DrawableComposite.cpp b/src/gui/graphics/drawables/juce_DrawableComposite.cpp index 7d1799ada9..c99f41062d 100644 --- a/src/gui/graphics/drawables/juce_DrawableComposite.cpp +++ b/src/gui/graphics/drawables/juce_DrawableComposite.cpp @@ -86,19 +86,19 @@ void DrawableComposite::bringToFront (const int index) void DrawableComposite::render (const Drawable::RenderingContext& context) const { - if (drawables.size() > 1) + if (drawables.size() > 0 && context.opacity > 0) { - Drawable::RenderingContext contextCopy (context); - - if (context.opacity >= 1.0f) + if (context.opacity >= 1.0f || drawables.size() == 1) { + Drawable::RenderingContext contextCopy (context); + for (int i = 0; i < drawables.size(); ++i) { const AffineTransform* const t = transforms.getUnchecked(i); contextCopy.transform = (t == 0) ? context.transform : t->followedBy (context.transform); - drawables.getUnchecked(i)->render (context); + drawables.getUnchecked(i)->render (contextCopy); } } else @@ -120,10 +120,6 @@ void DrawableComposite::render (const Drawable::RenderingContext& context) const context.g.drawImageAt (&tempImage, clipBounds.getX(), clipBounds.getY()); } } - else if (drawables.size() > 0) - { - drawables.getUnchecked(0)->render (context); - } } void DrawableComposite::getBounds (float& x, float& y, float& width, float& height) const