W3C home > Mailing lists > Public > public-canvas-api@w3.org > October to December 2011

Re: Please consider elliptical arc in canvas

From: Charles Pritchard <chuck@jumis.com>
Date: Sun, 13 Nov 2011 12:47:33 -0800
Message-Id: <2E05E2E9-0B8D-4BE0-A007-B512FA21A666@jumis.com>
Cc: "public-canvas-api@w3.org" <public-canvas-api@w3.org>
To: Shaofei Cheng <csf178@163.com>
There seems to be consensus that a drawPath-style method can be added to Canvas 2d. So you'd no longer need an svg path implementation.

Would that sufficiently address the issue?

-Charles



On Nov 13, 2011, at 3:27 AM, "Shaofei Cheng" <csf178@163.com> wrote:

> Hey guys,
> These days I'm working on a simple wrapping of canvas and just noticed that canvas leaks of elliptical canvas.arc APIs for path.
> 
> What I want to implement is like the following:
> 
>     var canvas = new CanvasWraper(myCanvas);
>     canvas.drawPath("M200,300 Q400,50 600,300 T1000,300");
> 
> The main purpose is to draw a path in canvas in SVG grammar. Everything goes well except the "A" command. Canvas 2d context do not have a API for arc of ellipse. So in the following picture(which is a sample of SVG). The left graph could be draw with canvas but the right could not.
> This path grammar is also supported by silverlight. 
> 
> So I suggest to add a elliptical arc API for path. With that we can keep the feature align with SVG.Also I think elliptical arc could be useful for some graphics games. 
> 
> (We are able to approx elliptical arc with cubic bezer, but I think the algorithm is too complex for web developers )
> 
> 
> Thanks,
> Shaofei Cheng
> 
> 
> 
> 
> 
> 
Received on Sunday, 13 November 2011 20:48:11 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 13 November 2011 20:48:11 GMT