Weird path rendering phenomena?

So, i have a weird phenomena here i cannot get rid of:
here I am using a gradient to stroke a path.
The path is just an open path.
Sometimes (depending on the path’s shape) I get these weird horizontal pixels rendering.
like the one in the top here.
If I use solid color, this does not happen.
It also happens to rounded rectangles with fillPath so it is not an issue with the stroke function.
It does not happen with the software renderer

This happened ever since I updated to 7.0.2
I have not tried to downgrade to 7.0.1 yet, but that is my next step.
Using MacOS Ventura 13.0.1

Any suggestions or input is welcome!

here is my code:

g.strokePath(round, PathStrokeType(2.f, PathStrokeType::curved,PathStrokeType::rounded));

Screenshot 2022-11-20 at 3.53.08 PM


I’m having the same problem, I’m on the latest JUCE develop tip. This is from an iphone SE on iOS 16:


I would suggest bisecting over JUCE to find the exact commit which broke this. This sometimes provides a lot of insight on the problem, and sometimes even a workaround in the form of a simple revert commit.

1 Like

Hi there, have you found a solution to the problem or found which commit caused this to start happening?

Bump :slightly_smiling_face:

If I attach an OpenGL context the artifact disappears. But this isn’t an option because on iOS the performance suffers a lot.

I wish I could help investigate the cause, but I am seeing this on an iOS 16 device and I can’t debug iOS 16 properly (I’m not on Xcode 14 yet so I can only install the app via Archive).

If the JUCE team are looking into this or if anyone has some tip that would be great.


If you can make a code example then I could check if this also reproduces on my macOS 12.5 setup.
If it does then I could try bisecting it.

The snippet in @assaf’s initial post refers to variables such as grad and round which are not included in the snippet, so I can’t make use of that one for a quick check.

1 Like

So, I managed to get this to disappear by adding the following preprocessor definition:

It only happens on the Core Graphics renderer

To recreate - set a ColourGradient and stroke a wriggly Path and try to animate it.
The artifacts will often appear - it has to do with the shape.

I am unable to dig into this further at this time, as the pile of paperwork on my desk has almost reached the ceiling! Hopefully, January will be calmer.


JUCE_COREGRAPHICS_RENDER_WITH_MULTIPLE_PAINT_CALLS=1 gets rid of the artifacts in my case as well. Thanks @assaf!

1 Like