Re: [whatwg] Canvas arcTo method

Hi Michael,

in your case, the first control point is not the same as the last point of
the subpath.
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);

Rik

PS
Doing the following doesn't' seem to work on chrome and ie9 because they
didn't implement the second radius parameter:

ctx.lineTo(100, 100);
ctx.arcTo(200, 100, 200, 200, 200, 100);


On Sun, Aug 19, 2012 at 8:10 PM, Michael Day <mikeday@yeslogic.com> wrote:

> Hi,
>
> The camvas arcTo method generates an arc that touches two tangent lines.
> The first tangent line is from the last point in the previous subpath to
> the first point passed to the arcTo method.
>
> What happens in this situation:
>
> ctx.lineTo(100, 100);
> ctx.scale(2, 1);
> ctx.arcTo(100, 100, 100, 200, 100);
>
> The current transformation matrix should be used to transform the
> generated arc, not to transform its control points.
>
> However, in this case the first untransformed control point is equal to
> the last point in the previous subpath, which means it must generate a
> straight line and not an arc.
>
> Firefox and Chrome do not do this, as can be seen by viewing the attached
> HTML file.
>
> What is the correct behaviour in this case?
>
> Best regards,
>
> Michael
>

Received on Monday, 20 August 2012 22:54:47 UTC