更新时间:2022-12-27 14:40:50
您可以使用
CGContextDrawPath(context, kCGPathFillStroke);
而不是
CGContextFillPath(context);
CGContextStrokePath(context);
问题是 CGContextFillPath()
和 CGContextStrokePath(上下文)
清除当前路径,以便只有第一个操作成功,第二个
操作什么都没画。 CGContextDrawPath()
结合填充和描边而不用
清除其间的路径。
The problem is that both CGContextFillPath()
and CGContextStrokePath(context)
clear the current path, so that only the first operation succeeds, and the second
operation draws nothing. CGContextDrawPath()
combines fill and stroke without
clearing the path in between.