码迷,mamicode.com
首页 > 其他好文 > 详细

一张图告诉你 canvas 中的 miterLimit 代表着什么

时间:2017-06-30 01:03:54      阅读:261      评论:0      收藏:0      [点我收藏+]

标签:路径   比例   code   max   nbsp   ima   limit   har   for   

一图胜千言, 图中有一条路径path, 沿着路径描了一条宽度为 width 的边, miterLimit 代表的是, 比例 ab/ac, 其中ac的长度为 1/2 width

技术分享

来看 mdn 上的描述, 进行验证

  • miterLimit = max miterLength / lineWidth = 1 / sin ( min θ / 2 )
  • The default miter limit of 10.0 will strip all miters for sharp angles below about 11 degrees.
  • A miter limit equal to √2 ≈ 1.4142136 (rounded up) will strip miters for all acute angles, keeping miter joins only for obtuse or right angles.
  • A miter limit equal to 1.0 is valid but will disable all miters.
  • Values below 1.0 are invalid for the miter limit.

 

一张图告诉你 canvas 中的 miterLimit 代表着什么

标签:路径   比例   code   max   nbsp   ima   limit   har   for   

原文地址:http://www.cnblogs.com/linyuzhaozhao/p/7096907.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!