SVG getBBox function returns zero in FireFox & Edge (but not in Chrome)

对着背影说爱祢 提交于 2020-01-07 05:31:07

问题


I have an svg element (created with D3).

while in chrome the "getBBox" function works fabulously, it fails in fireFox and Edge. Thought I saw this discussion in couple of places(e.g. here, here) none of them yielded a clear answer.

This doesn't work either - getBoundingClientRect() And my element is not underneath (i saw that it might cause issues).

Thanks alot!


回答1:


Ok, i found what was wrong.

Chrome can handle "g" elements with "display : none". but Firefox and edge treat it as "non-existing/zero dimensions".

sorry for the fuss.



来源:https://stackoverflow.com/questions/44438215/svg-getbbox-function-returns-zero-in-firefox-edge-but-not-in-chrome

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!