Ayoub Nouri
Ayoub Nouri

Reputation: 201

Draw circle using CAShapelayer issue

I'm drawing many circles using UIBezierPath and CAShapeLayer the issue is the edge of the circles are not rendered properly and it looks like a saw like in the screenshot below :

enter image description here

I tried to fix the problem by forcing the performance with this snippet but did not work:

   shapeLayer.shouldRasterize = true
   shapeLayer.rasterizationScale = UIScreen.main.scale

Upvotes: 0

Views: 163

Answers (1)

Ayoub Nouri
Ayoub Nouri

Reputation: 201

Thanks to @PunetSharma in fact i had only to increase the scale for retina devices as explained in this link to be:

shapeLayer.rasterizationScale = 2.0 * UIScreen.main.scale

Upvotes: 1

Related Questions