From a5e5831ea0f8f9bc4c3a39e080db65ab6c6beb20 Mon Sep 17 00:00:00 2001 From: ed Date: Mon, 5 Aug 2019 11:15:05 +0100 Subject: [PATCH] Don't apply FillType transform twice in CoreGraphicsContext::drawGradient() --- .../juce_graphics/native/juce_mac_CoreGraphicsContext.mm | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm b/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm index 3d4a76d583..8b69915ce8 100644 --- a/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm +++ b/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm @@ -754,14 +754,12 @@ void CoreGraphicsContext::drawGradient() auto& g = *state->fillType.gradient; - auto p1 = convertToCGPoint (g.point1); - auto p2 = convertToCGPoint (g.point2); - - state->fillType.transform.transformPoints (p1.x, p1.y, p2.x, p2.y); - if (state->gradient == nullptr) state->gradient = createGradient (g, rgbColourSpace); + auto p1 = convertToCGPoint (g.point1); + auto p2 = convertToCGPoint (g.point2); + if (g.isRadial) CGContextDrawRadialGradient (context, state->gradient, p1, 0, p1, g.point1.getDistanceFrom (g.point2), kCGGradientDrawsBeforeStartLocation | kCGGradientDrawsAfterEndLocation);