Use case: I will subclass UIView to create a custom view that "mattes" UIImage with a rounded rectangle (fixed the image with a rounded rectangle). The code works; I used a method similar to this question .
However, I want to stroke the clipping path to create a βframeβ. This works, but the strokes of the arc look noticeably different from the strokes. I tried adjusting the stroke width to large values ββ(at first I thought it was pixelation), but anti-aliasing seems to handle arcs and lines differently.
Here is what I see on the simulator:

This is the code that draws it:
CGContextSetRGBStrokeColor(context, 0, 0, 0, STROKE_OPACITY); CGContextSetLineWidth(context, 2.0f); CGContextAddPath(context, roundRectPath); CGContextStrokePath(context);
Does anyone know how to make these lines smooth?
ios core-graphics macos
makdad
source share