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

Dirk Schulze dschulze at adobe.com
Mon Sep 24 15:58:28 PDT 2012



On Sep 24, 2012, at 3:50 PM, "Ian Hickson" <ian at hixie.ch> wrote:

> 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().)
> 

Tab already noted that the SVG WG will add arc/arcTo ellipse/ellipseTo after user requests. And we would like to be as consistent with Canvas as possible. Making the path syntax more complex than it needs to be seems not to be an option for me. But you are right that it does not need to be a problem with the Canvas API.

To be honest it seems very confusing to me that Canvas has arc() and ellipse() but no ellipseTo() as pendant to ellipse().

Greetings,
Dirk

> -- 
> Ian Hickson               U+1047E                )\._.,--....,'``.    fL
> http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
> Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'



More information about the whatwg mailing list