SVG getBBox function returns zero in FireFox & Edg

2019-08-18 18:55发布

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条回答
可以哭但决不认输i
2楼-- · 2019-08-18 19:26

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.

查看更多
登录 后发表回答