check this script http://jsfiddle.net/T723E/ . Click on the rectangles and pay attention to the firebug console. Here, I hardcoded a .3 number, which is 300 pixels wide of a div containing svg node / 1000 user units.
After viewing the slit, this is the function I returned to get the scaled width without much (no math, I'm not sure.) Maths.Use matrix.d
to get the scaled height
var svg = document.getElementById('svg'); function getTransformedWidth(el){ var matrix = el.getTransformToElement(svg); return matrix.a*el.width.animVal.value; } var ele = document.getElementById('myElement_with_scale') console.log("scale width----", getTransformedWidth(ele))
Check out this script for full code http://jsfiddle.net/b4KXr/
source share