1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-08 04:20:09 +00:00

Added method Drawable::replaceColour

This commit is contained in:
jules 2014-02-12 14:50:24 +00:00
parent 14906d2293
commit 8ee40273f2
4 changed files with 37 additions and 0 deletions

View file

@ -107,6 +107,18 @@ void Drawable::setBoundsToEnclose (const Rectangle<float>& area)
setBounds (newBounds);
}
//==============================================================================
bool Drawable::replaceColour (Colour original, Colour replacement)
{
bool changed = false;
for (int i = getNumChildComponents(); --i >= 0;)
if (Drawable* d = dynamic_cast<Drawable*> (getChildComponent(i)))
changed = d->replaceColour (original, replacement) || changed;
return changed;
}
//==============================================================================
void Drawable::setOriginWithOriginalSize (Point<float> originWithinParent)
{