CGContextAddArc-CGContextAddArcToPoint

CGContextAddArc

CGContextAddArc does this:

addArc

where the red line is what will be drawn, sA is startAngle, eA is the endAngle, r is radius, and x and y are x and y. If you have a previous point the function will line from this point to the start of the arc (unless you are careful this line won't be going in the same direction as the arc).

CGContextAddArcToPoint

CGContextAddArcToPoint works like this:

addArc

Where P1 is the current point of the path, the x1, x2, y1, y2 match the functions x1, x2, y1, y2 and r is radius. The arc will start in the same direction as the line between the current point and (x1, y1) and end in the direction between (x1, y1) and (x2, y2). it won't line to (x2, y2) It will stop at the end of the circle.

UIBezierPath精讲

References

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • **2014真题Directions:Read the following text. Choose the be...
    又是夜半惊坐起阅读 13,402评论 0 23
  • 背景 一年多以前我在知乎上答了有关LeetCode的问题, 分享了一些自己做题目的经验。 张土汪:刷leetcod...
    土汪阅读 14,349评论 0 33
  • 刚刚过了5.20,现在是5.21,北京时间零点整。520可译为“我爱你”,因此520这一天朋友圈里感觉...
    Sunflower语阅读 5,199评论 0 1
  • 告别过去的日子还在不停唱着回忆的歌, 曾经的天空阳光灿烂而今却是树影婆娑, 阴晴圆缺阻挡不了江水东流澎湃之势, 那...
    53128a610bd4阅读 1,163评论 0 0
  • 业务场景: 一般来说,具有持久层的App同时都会附带着有版本迁移的需求。当一个用户安装了旧版本的App,此时更新A...
    Crazy2015阅读 3,991评论 0 0