SVG Tiny 1.2 defines a property called vector-effect.
<path vector-effect="non-scaling-stroke" stroke-width="2"></path>
With the above path, the stroke width will always be 2 pixels, even if the element gets scaled (due to a transform on a parent g element, for example).
This property seems to work in most of the SVG-supporting browsers, but not in IE9 and IE10.
Is there any way to feature-detect this property?
This works for me on Firefox and IE 9.
<script>
var elm = document.createElementNS("http://www.w3.org/2000/svg", "g");
if (elm.style.vectorEffect != undefined) {
alert("Supported");
} else {
alert("Not Supported");
}
</script>
Alternatively you could try Modernizr. Something like this I suppose.
Modernizr.testProp('vectorEffect')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With