W3C home > Mailing lists > Public > www-svg@w3.org > June 2004

Re: SVGTransform and SVGMatrix

From: Cameron McCormack <cam-www-svg@aka.mcc.id.au>
Date: Sat, 12 Jun 2004 11:37:48 +1000
To: www-svg@w3.org
Message-ID: <20040612013748.GA3783@mcc.id.au>

Hi Jonathan.

Jonathan Watt:
> >>So the SVGMatrix stored by an SVGTransform should be its own private
> >>copy? I.e. the SVGMatrix object passed into setMatrix() and returned by
> >>the attribute matrix, are not the same SVGMatrix object as the one
> >>stored by the SVGTransform object?
> >
> >
> >That is my understanding. I don't have it handy otherwise I check, but you
> >may want to look at what Batik is doing. Chances are they are using the
> >correct interpretation since some of the developers are on the working
> >group.
> Ahh, I just uninstalled Java because I ran out of HDD space. Any chance 
> anyone else happens to know what Batik does? Or any WG people listening?

Batik doesn't keep a reference to the SVGMatrix passed in to setMatrix,
it just uses the SVGMatrix to modify the SVGTransform's internal
representation of the transformation.  And when the matrix attribute is 
referred to a new SVGMatrix object is returned.  But modifying this new
SVGMatrix object still does affect the SVGTransform.

This sort of thing happens a lot in the Batik code.  In this case, when
you refer to the matrix attribute of the SVGTransform an instance of an
anonymous class inheriting from AbstractSVGMatrix is returned, whose
setA..setF methods affect the SVGTransform.


Cameron McCormack
|  Web: http://mcc.id.au/
|  ICQ: 26955922
Received on Friday, 11 June 2004 21:37:53 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 March 2017 09:46:59 UTC