Re: SVGTransform and SVGMatrix

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

-- 
Cameron McCormack
|  Web: http://mcc.id.au/
|  ICQ: 26955922

Received on Friday, 11 June 2004 21:37:53 UTC