W3C home > Mailing lists > Public > whatwg@whatwg.org > March 2009

[whatwg] Canvas - Exception on arc with negative radius

From: Dirk Schulze <vbs85@gmx.de>
Date: Fri, 27 Mar 2009 20:50:47 +0100
Message-ID: <1238183447.18321.4.camel@dirk-laptop>

why does the spec want an INDEX_SIZE_ERR exception on arc's with a
negative radius? This blocks further drawings. 

Here is a short example:

<!DOCTYPE html>
    function drawShape()
        var canvas = document.getElementById("canvas");
        var ctx = canvas.getContext("2d");

        //arc(x, y, radius, startAngle, endAngle, anticlockwise)
        ctx.arc(30, 30,-20, 0, 2*Math.PI, false);

<body onload="drawShape();">
<canvas id="canvas" width="100" height="60">

The circle, drawn by the arc, has a negative radius. A negative radius
doesn't make sense for circles, but an INDEX_SIZE_ERR exception stops
further drawing of the rect, even if the code is ok there.

Another example is: http://blahbleh.com/molecools.php?name=1,2%

If you turn the molecule a bit, the circles disappear with a
INDEX_SIZE_ERR exception.

Isn't it better to just ignore the arc and go on with the drawing, like
Firefox does? And perhaps the same for arcTo?

Received on Friday, 27 March 2009 12:50:47 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:48 UTC