mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-31 03:00:05 +00:00
Added method Drawable::replaceColour
This commit is contained in:
parent
14906d2293
commit
8ee40273f2
4 changed files with 37 additions and 0 deletions
|
|
@ -452,3 +452,21 @@ void DrawableShape::FillAndStrokeState::setStrokeType (const PathStrokeType& new
|
|||
state.setProperty (capStyle, newStrokeType.getEndStyle() == PathStrokeType::butt
|
||||
? "butt" : (newStrokeType.getEndStyle() == PathStrokeType::square ? "square" : "round"), undoManager);
|
||||
}
|
||||
|
||||
static bool replaceColourInFill (DrawableShape::RelativeFillType& fill, Colour original, Colour replacement)
|
||||
{
|
||||
if (fill.fill.colour == original && fill.fill.isColour())
|
||||
{
|
||||
fill = FillType (replacement);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DrawableShape::replaceColour (Colour original, Colour replacement)
|
||||
{
|
||||
bool changed1 = replaceColourInFill (mainFill, original, replacement);
|
||||
bool changed2 = replaceColourInFill (strokeFill, original, replacement);
|
||||
return changed1 || changed2;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue