I need to find the visible x and y bounds of an object which has been clipped, so that I can place other objects around it. However, the spec states that getBBox
doesn't take into account clip paths, so I can't use the bounding box. Any idea how can I can find the display limits for a clipped object?
Create a hidden <use>
element that references the path in the clipPath and get the bounding box of that. Then you just want the intersection of the bounding box of your object and the use object.
<defs>
<clipPath id="clipPath">
<path id="path" ...>
</clipPath>
</defs>
<use id="clipPathBounds" visibility="hidden" xlink:href="#path"/>
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