Re: SVGTransform and SVGMatrix

Kevin Lindsey wrote:

>>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?

>>Obviously the answer to that question makes quite a difference to the
>>outcome of the following script.
>>
>>var matrix1   = getANewSVGMatrix();
>>var transform = getANewSVGTransform();
>>transform.setMatrix(matrix1);
>>var matrix2   = transform.matrix;
>>matrix1.a += 2;
>>matrix2.b += 2;
>>
>>If SVGTransform objects don't keep their own private SVGMatrix object
>>then the changes to matrix1 and matrix2 would affect each other and
>>transform.
> 
> 
> Right. This may be a good example of why the matrix attribute is defined the
> way it is. Since SVGMatrix maintains its own private copy, matrix1 and
> matrix2 would be independent of one another.
> 
> Kevin


Hmm. Perhaps a name other than *set*SVGMatrix would have been less 
confusing, but it's too late now I guess.

Thanks very much for your replies Kevin! Much appreciated. :)

Jonathan

Received on Friday, 11 June 2004 17:11:13 UTC