You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when you have a SVG element responsive with height and width define to 100% at the transformation to picture the result is not correct due to the dynamic size of the element and it result with a deformation of the render.
The solution is to pickup the clientWidth and clientHeight to the node and edit height width attributes with the corrects values.
Bug reports:
Example : https://jsfiddle.net/9dhs999e/9/
when you have a SVG element responsive with height and width define to 100% at the transformation to picture the result is not correct due to the dynamic size of the element and it result with a deformation of the render.
The solution is to pickup the clientWidth and clientHeight to the node and edit height width attributes with the corrects values.
if ( /[0-9]{1,}\%/i.test(node.getAttribute('width')) || /[0-9]{1,}\%/i.test(node.getAttribute('height')) || /[0-9]{1,}\%/i.test(node.style.width) || /[0-9]{1,}\%/i.test(node.style.height) ) { if (!node.clientWidth && !node.clientHeight && node.parentNode) { node.setAttribute('width', window.getComputedStyle(node.parentNode).width); node.setAttribute('height', window.getComputedStyle(node.parentNode).height); } else { node.setAttribute('width', node.clientWidth); node.setAttribute('height', node.clientHeight); } }
Example : https://jsfiddle.net/4fxwwbh8/1/
Specifications:
The text was updated successfully, but these errors were encountered: