0

GWTを使用してWebアプリを構築する方法を学んでいます。円弧を描きたいのですが、始点と終点の角度に関係なく、常に完全な円になります。私はもう試した

context2d.arc((double)cx, (double)cy, 40., 0., 180., true);
context2d.stroke();

context2d.beginPath();
context2d.arc((double)cx, (double)cy, 40., 0., 180., true);
context2d.closePath();
context2d.stroke();

そして、私が完全な円を得るたびに。context2d.save()前後に追加しましたがcontext2d.restore()、まだ完全な円です。

4

1 に答える 1

1

ドキュメントから

startAngle - the start angle, measured in radians clockwise from the positive x-axis
endAngle - the end angle, measured in radians clockwise from the positive x-axis

0 と 180 は度です。

180 の代わりに 3.14159265 を使用してみてください (実際にはラジアンで 180 度です)。

于 2013-01-24T22:09:17.453 に答える