SVGSVGElement: currentScale 屬性
SVGSVGElement 介面的 currentScale 屬性反映了相對於初始檢視的當前縮放因子,用於考慮使用者對最外層 <svg> 元素的縮放和移動操作。
DOM 屬性 currentScale 和 currentTranslate 等價於 2x3 矩陣 [a b c d e f] = [currentScale 0 0 currentScale currentTranslate.x currentTranslate.y]。如果啟用了“縮放”(即 zoomAndPan="magnify"),那麼其效果就像在 SVG 文件片段的最外層(即在最外層 <svg> 元素之外)應用了一個額外的變換。
如果 <svg> 元素不在最外層,那麼 currentScale 始終為 1,對其進行設定無效。