I have got multiple elements in my canvas. I want to find all elements that are intersecting/overlapping currently chosen element.
Is there a way to find this out in raphael Js???
EDIT
To clarify further, lets suppose I get an element by getByID(), is there a way for me to get ALL elements(that are already present in canvas) that intersect with it.
Thought a little bit more and I think the best solution should be converting the elements into paths and then comparing if they are intersecting. (I have used jQuery in my example, but ou can easily do it without jQuery).
I dont think that for
rectandcircleyou can get a path. But it is pretty easy to write a function for convertingrectinto path (since you know x,y all you need to do is add combination of width and Height). Forcircleuse this link.I was hoping to get a function embedded in Raphael that could do this, but as Joker said “Can’t rely on anyone these days, you have to do everything yourself, don’t we!”. Just Kidding. RaphaelJs is damn neat.