[whatwg] [Canvas] Behavior on non-invertable CTM

Ian Hickson ian at hixie.ch
Thu Feb 6 14:55:27 PST 2014


On Thu, 6 Feb 2014, Justin Novosad wrote:
>
> I am looking into correcting Chrome's behavior to make it spec-compliant in
> this case.  There is one specific primitive that is proving problematic:
> arcTo
>
> The problem is that the algorithm needs to bring the last point in the 
> subpath into the arc's local coordinate space, which requires inverting 
> the CTM.
> 
> Current text: If the point (x0, y0) is equal to the point (x1, y1), or 
> if the point (x1, y1) is equal to the point (x2, y2), or if both radiusX 
> and radiusY are zero, then the method must add the point (x1, y1) to the 
> subpath, and connect that point to the previous point (x0, y0) by a 
> straight line.

I don't understand why this needs the last point in the subpath to be 
converted to the arc's local coordinate space, rather than the other way 
around. Can you elaborate? why can't you convert all the points to the 
current coordinate space before doing the comparisons?

(I'm probably missing something critical here.)


> As far as I can tell, quadraticCurveTo and bezierCurveTo do not have 
> this problem because the curves can be computed by first transforming 
> all points to global coordinate space, to compute the curves in global 
> space.

Why is this not the case for arcs?

-- 
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