If I use getCTM() to get the current tranformation matrix, how do I use that object to set the matrix if I want to restore it at a later point (I know about save and restore but
function setCTM(someitem,m) {
return someitem.transform.baseVal.initialize(
someitem.ownerSVGElement.createSVGTransformFromMatrix(m));
}
If, instead of saving someItem.getCTM()
, you save someitem.transform.baseVal.getitem(0)
, you can use:
function setTransform(someitem,t) {
return someitem.transform.baseVal.initialize(t));
}