Snap.svg bounding box not updated on child elements after applying transform to parent g element

风格不统一 提交于 2019-12-12 01:07:56

问题


Codepen: http://codepen.io/anon/pen/dfIBv

I have two rectangles in g element on which I apply transform. GetBBox method shows same numbers after and before transform.

If I apply same transform directly on those rectangles, getBBox method shows correct measurements.

Is there any way how to get "correct" measurements of these rectangles after applying transform to parent group element?

Thanks!


回答1:


Ian is correct. element.node.getBoundingClientRect() shows correct measurements. Thank you :)



来源:https://stackoverflow.com/questions/21533687/snap-svg-bounding-box-not-updated-on-child-elements-after-applying-transform-to

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