mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Prevented ColourGradient from having multiple colour stops at 0
This commit is contained in:
parent
d32c64d590
commit
708e357e3c
1 changed files with 7 additions and 1 deletions
|
|
@ -70,7 +70,13 @@ int ColourGradient::addColour (const double proportionAlongGradient, Colour colo
|
|||
// must be within the two end-points
|
||||
jassert (proportionAlongGradient >= 0 && proportionAlongGradient <= 1.0);
|
||||
|
||||
const double pos = jlimit (0.0, 1.0, proportionAlongGradient);
|
||||
if (proportionAlongGradient <= 0)
|
||||
{
|
||||
colours.set (0, ColourPoint (0.0, colour));
|
||||
return 0;
|
||||
}
|
||||
|
||||
const double pos = jmin (1.0, proportionAlongGradient);
|
||||
|
||||
int i;
|
||||
for (i = 0; i < colours.size(); ++i)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue