定义
setLineDash(segments)
- segments
一个数组,用于指定交替绘制直线和间隙的距离(以坐标空间单位表示)。如果数组中元素的个数是奇数,数组中的元素会被复制并连接起来。例如,[5, 15, 25] 将变成 [5, 15, 25, 5, 15, 25]。如果数组为空,破折号列表将被清除,行描边将恢复为实线。
例子
以 [25, 10, 18]举例,因为数组长度是奇数,实际会扩展为[25, 10, 18, 25, 10, 18]
是线条和空隙的长度。
参阅
具体详情参阅:https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/setLineDash
标签:25,15,setLineDash,10,CanvasRenderingContext2D,数组,method From: https://www.cnblogs.com/XingXiaoMeng/p/18090907