--- In [email protected], Cameron McCormack <[EMAIL PROTECTED]> 
wrote:
>
> Hi Kam-Hung.
> 
> Kam-Hung Soh:
> > My Javascript code has been modifying an element's transformation
> > matrix like this:
> > 
> > var sMatrix = "matrix(" + a + " " + ... + " " + f + ")";
> > elem.setAttributeNS(null, "transform", sMatrix);
> > 
> > Is there a more direct way to do this?  I had a look in the W3 SVG
> > specifications and there are methods to obtain a CTM and manipulate
> > its values, but there doesn't seem to be a way to set the CTM of an
> > element.
> 
> You can do this:
> 
>   var svg = document.documentElement;
>   var m = document.createSVGMatrix();
>   m.a = a;
>   m.b = b;
>   m.c = c;
>   m.d = d;
>   m.e = e;
>   m.f = f;
>   elem.transform.baseVal.initialize
>     (svg.createSVGTransformFromMatrix(m));
> 
> but it seems a bit more verbose…
> 
> -- 
> Cameron McCormack, http://mcc.id.au/
>       xmpp:[EMAIL PROTECTED]  ▪  ICQ 26955922  ▪  MSN [EMAIL PROTECTED]
>

Cool.  I'll give it a go.

Maybe because I'm not yet in the SVG mindset, the sequence of objects
seems rather obscure.  Why does "transform" have a "baseVal"?

-- 
Kam-Hung Soh
http://kamhungsoh.blogspot.com - It Mostly Works
http://members.optusnet.com.au/khsoh - Software That Mostly Works





------------------------ Yahoo! Groups Sponsor --------------------~--> 
Home is just a click away.  Make Yahoo! your home page now.
http://us.click.yahoo.com/DHchtC/3FxNAA/yQLSAA/1U_rlB/TM
--------------------------------------------------------------------~-> 

-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
---- 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/svg-developers/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to