我知道一种非常简单的方法来获取任何SVG元素的当前矩阵变换:
// 't' is a string
var t = window.getComputedStyle(nativeElement, null).transform
console.log(t);
问题在于先前的方法返回的数字最多只有六位小数。例如,先前的代码可能会返回:
matrix(0.965926, 0.258819, -0.258819, 0.965926, 0, 0)
有没有一种更准确地获取任何SVG元素的矩阵变换的方法?