请问为什么月亮变成了一个大半圆?用stroke画出来没问题,一填色就是半圆
function drawMoon(cxt,x,y,R,rot){
cxt.save();
cxt.translate(x,y);
cxt.scale(R,R);
cxt.rotate(rot/180*Math.PI);
moonPath(cxt);
cxt.fillStyle = "white";
cxt.fill();
cxt.restore();
}
function moonPath(cxt){
cxt.beginPath();
cxt.arc(0,0,1,1.5*Math.PI,0.5*Math.PI,false);
cxt.moveTo(0,-1);
cxt.arcTo(1.2,0,0,1,dis(1.2,0,0,-1)/1.2);
cxt.closePath();
}
function dis(x1,y1,x2,y2){
return Math.sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
}