[whatwg] Canvas Path.addPath SVGMatrix not optimal?
junov at google.com
Thu Mar 20 07:01:50 PDT 2014
On Wed, Mar 19, 2014 at 5:47 PM, Rik Cabanier <cabanier at gmail.com> wrote:
> On Wed, Mar 19, 2014 at 2:22 PM, Justin Novosad <junov at google.com> wrote:
>> 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
>> after creating a canvas rendering context: var identity =
> Hi Justin,
> did Blink already expose this property?
It is implemented, but not exposed (hidden behind the experimental canvas
> As currently specified, this must return a live SVGMatrix object, meaning
> that as you change the CTM on the 2d context, your reference to the
> SVGMatrix should change as well. 
D'oh! I totally missed that when I reviewed the implementation. In fact,
the implementer even went to great length to ensure the opposite behavior
(making a copy).
I'll make sure that gets fixed.
> It's unlikely that you actually want this...
> This API should be renamed to get/setCurrentTransform() and return a copy.
Yes, making a copy felt like the most desirable behavior, so I did not
think twice about the fact that the implementation performs a copy.
Anyways, thanks for catching this.
More information about the whatwg