[whatwg] Canvas arcTo method
Ian Hickson
ian at hixie.ch
Mon Sep 3 08:58:57 PDT 2012
On Mon, 20 Aug 2012, Michael Day wrote:
>
> 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.
The intent is that the whole thing be done in the transformed coordinate
space. The spec was rather poorly written, I've made it slightly better
(though only minimally so... I'm not really sure how to write the spec to
be both clear and accurate).
On Tue, 21 Aug 2012, Michael Day wrote:
>
> For arcTo, it's much less obvious how the arc should be generated from
> the three control points, when the first control point is transformed by
> a different matrix to the last two; in this case you cannot just
> remember the three points in absolute canvas coordinates, but the
> specification does not clarify this.
Does it work if you just transform all the points and the line?
(Yeah, that's still way too vague. I'm not sure how to really specify
this in a manner that's both unambiguous and clear. Any suggestions?)
On Tue, 21 Aug 2012, Michael Day wrote:
>
> You cannot transform the three control points, and then generate the
> arc. If you do this, you will always get circular arcs, whereas a
> scale(2, 1) will produce an elliptical arc. You have to generate the
> arc, then scale it.
Yeah, that's why the spec hand-waves to transform the line too... but I
agree that that doesn't really work.
Do you have any suggestion of how to spec this better?
--
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