[whatwg] Canvas arcTo method
Michael Day
mikeday at yeslogic.com
Mon Aug 20 17:55:09 PDT 2012
Hi Rik,
> The 'scale(2,1)' set up a different coordinate system. You can rewrite
> your code from this:
>
> ctx.lineTo(100, 100);
> ctx.scale(2, 1);
> ctx.arcTo(100, 100, 100, 200, 100);
>
> to this:
>
> ctx.scale(2, 1);
> *ctx.lineTo(50, 100);*
> ctx.arcTo(100, 100, 100, 200, 100);
Right, these will produce the same arc. But how should this be
implemented in the user agent?
It's almost like it is getting the last point in the previous subpath,
transforming it by the inverse of the current transformation matrix,
generating the arc, and then transforming the arc by the matrix.
Is this what Firefox and Chrome do? There is no hint of this in the
spec, which is quite ambiguous about how the current transform should
affect previous subpaths.
Cheers,
Michael
More information about the whatwg
mailing list