1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-21 01:24:21 +00:00

fixed a bug in DrawableComposite

This commit is contained in:
Julian Storer 2009-08-28 09:59:11 +01:00
parent 8073ca1f5b
commit e89efe0f0d
2 changed files with 10 additions and 18 deletions

View file

@ -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

View file

@ -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