Re: "liveness" of SVGMatrix

On Tue, Jul 1, 2008 at 12:54 AM, Erik Dahlström <ed@opera.com> wrote:

> What are the use-cases of having SVGTransform::setMatrix adopt the
> passed-in matrix?
>
> IMHO it seems a bit weird to let it be live in this scenario, especially
> given that there are methods for setting translation, rotation etc on the
> SVGTransform interface. These would then affect the passed-in matrix too.
>
> Another way to get the liveness:
> tfm.setMatrix(mtx); // setting values of the tfm.matrix from mtx
> mtx = tfm.matrix; // mtx is now live


Yeah, that's fine. Just say in setMatrix that the passed-in matrix is
copied, not adopted.

Another question then is if the createSVGTransformFromMatrix method (on
> SVGSVGElement and SVGTransformList) also behaves the same. My testing for
> createSVGTransformFromMatrix so far concludes that all viewers treat the
> passed-in matrix as disconnected from the created SVGTransform (i.e. it's
> not live).


Fine. Just make the spec state that.


>
>
>  Also, I don't understand the entry for "consolidate":
>>
>>> The returned item is the item itself and not a copy. Any changes made to
>>>
>> the item are immediately reflected in the list.
>> I don't think this is right. For lists with more than one matrix, this
>> doesn't seem to make any sense.
>>
>
> Agreed. How about:
> "If the list contains more than one item, then the consolidated matrix is
> written to the first item in the list while the other items are removed from
> the list. The returned item is the first item in the list, and is the item
> itself and not a copy. Any changes made to the item are immediately
> reflected in the list."


You mean accessing the "consolidate" attribute has the side-effect of
reducing the list to one element? That doesn't sound like a good idea to me.
I think "consolidate" should just return a new matrix object every time
which is a copy of the multiplied-together matrices.

Thanks,
Rob
-- 
"He was pierced for our transgressions, he was crushed for our iniquities;
the punishment that brought us peace was upon him, and by his wounds we are
healed. We all, like sheep, have gone astray, each of us has turned to his
own way; and the LORD has laid on him the iniquity of us all." [Isaiah
53:5-6]

Received on Tuesday, 1 July 2008 02:39:55 UTC