From fb43fbb37f4aa100497049fa2488fa32ee1551ed Mon Sep 17 00:00:00 2001 From: jules Date: Mon, 5 Feb 2018 12:18:59 +0000 Subject: [PATCH] Fix for CoreGraphics clipping to zero-winding paths --- .../juce_graphics/native/juce_mac_CoreGraphicsContext.mm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm b/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm index a76f10d01b..7aa4b5aa34 100644 --- a/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm +++ b/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm @@ -274,7 +274,12 @@ void CoreGraphicsContext::excludeClipRectangle (const Rectangle& r) void CoreGraphicsContext::clipToPath (const Path& path, const AffineTransform& transform) { createPath (path, transform); - CGContextClip (context); + + if (path.isUsingNonZeroWinding()) + CGContextClip (context); + else + CGContextEOClip (context); + lastClipRectIsValid = false; }