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

Added an assertion to catch some unexpected behaviour in the CoreGraphics gradient renderer

This commit is contained in:
jules 2016-04-27 16:12:37 +01:00
parent 0cd926a199
commit 01e2e53160

View file

@ -707,6 +707,10 @@ static CGGradientRef createGradient (const ColourGradient& g, CGColorSpaceRef co
*comps++ = (CGFloat) colour.getFloatBlue();
*comps++ = (CGFloat) colour.getFloatAlpha();
locations[i] = (CGFloat) g.getColourPosition (i);
// There's a bug (?) in the way the CG renderer works where it seems
// to go wrong if you have two colour stops both at position 0..
jassert (i == 0 || locations[i] != 0);
}
return CGGradientCreateWithColorComponents (colourSpace, components, locations, (size_t) numColours);