diff --git a/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm b/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm index 3e806498c3..584e6e7945 100644 --- a/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm +++ b/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm @@ -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);