W3C home > Mailing lists > Public > whatwg@whatwg.org > September 2012

Re: [whatwg] Rename the 7-arg arcTo() to ellipseTo()?

From: Ian Hickson <ian@hixie.ch>
Date: Mon, 24 Sep 2012 22:50:10 +0000 (UTC)
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Message-ID: <Pine.LNX.4.64.1209242246430.1904@ps20323.dreamhostps.com>
Cc: WHATWG List <whatwg@whatwg.org>
On Mon, 24 Sep 2012, Tab Atkins Jr. wrote:
> 
> You are looking at the simplest possible use-case for A/a, nearly the 
> only case that can be done without trig, where you're starting and 
> stopping the arc at a quarter-turn.  Try virtually anything more 
> complex, like rotating the square 45deg.  Using arcTo it's still trivial 
> - you just need to know enough trig to figure out that the corners are 
> now at (0, 1.414), etc., and the command takes care of the rest for you.  
> With A/a, you need to do a bit more to translate the points of the 
> diamond into the start/end of the arc.
> 
> Don't even get me started on trying to do a 5-pointed star with rounded 
> corners.
> 
> In general, if you can do a sharp corner, you can do a rounded corner 
> with arcTo.  You need no additional information.  arcBetween almost 
> always needs significantly more information.

Fair enough.

Anyway, my original point stands: I don't see why this would have any 
impact on the canvas API. The API to be consistent with is the existing 
path API, not the canvas one. If you did want to introduce optional 
arguments to the path API, though, that would be relatively trivial; just 
introduce a punctuation mark that means "end of arguments", e.g. "/".

   B 10,10 20,20 5 / 30,30 40,40 10

...instead of:

   B 10,10 20,20 5 5 0 30,30 40,40 10 5 0

...(where B is a command that takes the same arguments as arcTo().)

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Monday, 24 September 2012 22:53:43 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:45 UTC