From: Philip Taylor <pjt47@cam.ac.uk>

Date: Sun, 27 Apr 2008 02:19:46 +0100

Message-ID: <4813D4B2.4030904@cam.ac.uk>

To: HTML WG <public-html@w3.org>

Date: Sun, 27 Apr 2008 02:19:46 +0100

Message-ID: <4813D4B2.4030904@cam.ac.uk>

To: HTML WG <public-html@w3.org>

http://www.whatwg.org/specs/web-apps/current-work/multipage/section-the-canvas.html#arcx- says: "The points at startAngle and endAngle along the circle's circumference, measured in radians clockwise from the positive x-axis, are the start and end points respectively. The arc is the path along the circumference of this circle from the start point to the end point ... . Since the points are on the circle, as opposed to being simply angles from zero, the arc can never cover an angle greater than 2π radians. If the two angles are equal, or if the radius is zero, then the arc is defined as being of zero length in both directions." That definition would break either ctx.arc(x, y, 0, 2*Math.PI, true); or ctx.arc(x, y, 0, 2*Math.PI, false); since one of them would be drawn as very nearly zero length, depending on whether 2*Math.PI is <2π or >2π. People (at least me) expect both of those cases to draw an entire circle. Suggested replacement: "The points at startAngle and endAngle along the circle's circumference, measured in radians clockwise from the positive x-axis, are the start and end points respectively. If 'anticlockwise' is false and endAngle >= startAngle + 2π, or if 'anticlockwise' is true and startAngle >= endAngle + 2π, then the arc is the whole circumference of the circle. Otherwise, the arc is the path along the circumference of this circle from the start point to the end point ... [and the rest the same as before]" That works as expected in the (0, 2*Math.PI+/-epsilon) case, and is tolerant of errors in the angles (since a small change in the input won't cause a big change in the output). It matches the arcs drawn by Firefox and Safari, with the only difference being that it does no overdraw for >2π arcs (which is usually an invisible effect anyway). -- Philip Taylor pjt47@cam.ac.ukReceived on Sunday, 27 April 2008 01:20:19 UTC

*
This archive was generated by hypermail 2.3.1
: Thursday, 29 October 2015 10:15:32 UTC
*