JS SVG getCTM and setCTM?

后端 未结 2 854
离开以前
离开以前 2021-02-02 02:00

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

2条回答
  •  一个人的身影
    2021-02-02 02:21

    var transform = ownerSVGElement.createSVGTransform()
    
    transform.setMatrix(elem.getCTM())
    
    someelement.transform.baseVal.initialize(transform)
    

提交回复
热议问题