Smoothing a rounded stroke in Core Graphics

后端 未结 2 1180
一个人的身影
一个人的身影 2020-12-19 15:46

I am creating my own UITableViewCells with a gradient background. I have all the logic and drawing worked out, but one thing I want to fix is the \"chunkiness\" around the

2条回答
  •  醉梦人生
    2020-12-19 16:33

    The other way to make the stroke consistent would be to move the AddPath and StrokePath calls up above the RestoreGState call—that is, stroke while clipped.

    For a truly 2-pt-wide stroke with this solution, simply double the line width you put in the graphics state (i.e., set it to 4 pt), since half of it will be clipped out.

提交回复
热议问题