svgdotjs / svg.js

The lightweight library for manipulating and animating SVG
https://svgjs.dev
Other
11.15k stars 1.08k forks source link

Search in docs does not work #1330

Open SebastianStehle opened 4 days ago

SebastianStehle commented 4 days ago

Hi,

for me the search does not work anymore and the Github icon is also broken.

Just another question: Is there an easy solution to implement a hit test on rotated bounding boxes?

Fuzzyma commented 4 days ago

Thanks for letting me know.

You can use rbox() to get the client react around an object. But that's still a box. So if you rotate a react, the rectangle around taht rotated rectangle. That doesn't work well with hit tests. You probably need to do the math yourself.

What works best is to transform the hit test point into the coordinate system of the object and do the hit test in the objects coordinate system