W3C home > Mailing lists > Public > whatwg@whatwg.org > March 2014

Re: [whatwg] Canvas Path.addPath SVGMatrix not optimal?

From: Justin Novosad <junov@google.com>
Date: Wed, 19 Mar 2014 17:22:58 -0400
Message-ID: <CABpaAqT4_XGj7SSjrp1M8bBBUtbBsGO+9ga_vAxamvdes_Na-Q@mail.gmail.com>
To: Dirk Schulze <dschulze@adobe.com>
Cc: whatwg <whatwg@lists.whatwg.org>
On Wed, Mar 19, 2014 at 4:46 PM, Dirk Schulze <dschulze@adobe.com> wrote:

> Hi,
>
> I just looked at the definition of Path.addPath[1]:
>
>     void addPath(Path path, SVGMatrix? transformation);
>
> SVGMatrix is nullable but can not be omitted all together. Why isn’t it
> optional as well? I think it should be optional, especially because
> creating an SVGMatrix at the moment means writing:
>
>     var matrix = document.createElementNS('http://www.w3.org/2000/svg
> ','svg').createSVGMatrix();
>
> Greetings,
> Dirk
>
> [1]
> http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#path


I agree it should be optional, but just to play devil's advocate : you can
create an identity SVGMatrix with a simpler bit of code. Just do this right
after creating a canvas rendering context: var identity =
context.currentTransform;

    -Justin
Received on Wednesday, 19 March 2014 21:34:48 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:17 UTC