【发布时间】:2014-01-27 02:35:24
【问题描述】:
所以我想画一个圆圈,用黑色和红色的轮廓填充蓝色。红色部分由look 角度决定。 ctx 变量保存 2d 上下文。
相关代码:
ctx..lineWidth = 0.5
..fillStyle = "#0000AA"
..strokeStyle = "red";
ctx.beginPath();
ctx.arc(pos.x, pos.y, radius, look - PI / 6, look + PI / 6);
ctx..fill()
..closePath()
..stroke()
..beginPath();
ctx.strokeStyle = "black";
ctx.arc(pos.x, pos.y, radius, look + PI / 6, look - PI / 6);
ctx..fill()
..closePath()
..stroke();
但是,这会在圆圈内绘制一条额外的红线,这是我不想要的。我怎样才能摆脱这条线?
【问题讨论】: