Browse Source

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

tags/2021-05-28
jules 9 years ago
parent
commit
01e2e53160
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm

+ 4
- 0
modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm View File

@@ -707,6 +707,10 @@ static CGGradientRef createGradient (const ColourGradient& g, CGColorSpaceRef co
*comps++ = (CGFloat) colour.getFloatBlue(); *comps++ = (CGFloat) colour.getFloatBlue();
*comps++ = (CGFloat) colour.getFloatAlpha(); *comps++ = (CGFloat) colour.getFloatAlpha();
locations[i] = (CGFloat) g.getColourPosition (i); 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); return CGGradientCreateWithColorComponents (colourSpace, components, locations, (size_t) numColours);


Loading…
Cancel
Save