我是拉斐尔的初学者。实际上甜甜圈逆时针开始我有一个http://jsfiddle.net/fahim/dNp24/我怎么能顺时针做这个。
function sector(cx, cy, r, startAngle, endAngle, params) {
var x1 = cx + r * Math.cos(-startAngle * rad),
x2 = cx + r * Math.cos(-endAngle * rad),
y1 = cy + r * Math.sin(-startAngle * rad),
y2 = cy + r * Math.sin(-endAngle * rad),
xx1 = cx + r2 * Math.cos(-startAngle * rad),
xx2 = cx + r2 * Math.cos(-endAngle * rad),
yy1 = cy + r2 * Math.sin(-startAngle * rad),
yy2 = cy + r2 * Math.sin(-endAngle * rad);
return paper.path([
"M", cx, cy,
"L", x1, y1,
"A", r, r, 0, +(endAngle - startAngle > 180), 0, x2, y2,
"L", xx2, yy2,
"A", r2, r2, 0, +(endAngle - startAngle > 180), 1, xx1, yy1,
"z"])
.attr(params);