Chrome 中的画布半圆错误解决方法
看起来有人确实在 Chromium 论坛上提到了这个错误,但没有解决方案,所以我想知道是否有人知道解决方法。
问题是尝试使用 canvas 元素在 Chrome 中逆时针渲染半圆。相反,这会呈现一个完整的圆圈:
var ctx = document.getElementById('can').getContext('2d');
ctx.beginPath();
ctx.arc(50,50,50,0,Math.PI*3,true);
ctx.fill();
ctx.closePath();
这是一个小提琴,在非 chrome 中查看,然后在 chrome 中查看: fiddle
It looks like someone did mention this bug to the Chromium forums but there was no resolution so I'm wondering if anyone simply knows a workaround.
The issue is trying to render a half circle counter-clockwise in Chrome, using the canvas element. Instead this renders a full circle:
var ctx = document.getElementById('can').getContext('2d');
ctx.beginPath();
ctx.arc(50,50,50,0,Math.PI*3,true);
ctx.fill();
ctx.closePath();
Here is a fiddle, view in non-chrome, then in chrome: fiddle
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该错误可能源于 规范的这一部分:
Chrome 似乎不尊重该声明的第二部分(即,当
逆时针
为true
时)。为什么不标准化你的终点呢?
The bug probably stems from this part of the spec:
Chrome does not appear to respect the second part of that statement (i.e. when
anticlockwise
istrue
).Why not normalize your end-point?