Monday, 17 April 2023

KonvaJS - how to check if Line is inside other Node

Looking for help. I need to check if one node (in my case it's Line) is inside another node (can be different shapes). In my case, I need to check if the Red Line is inside Blue Node.

My attempt: https://codesandbox.io/s/infallible-wing-xmy2pi

Edit:

My goal is to check whether a separate node (in my case -> the Red Line) is COMPLETELY inside (over) the Blue Node. They are both separate nodes (Red Line is not a child of the Blue Box and vice versa).

The Blue Node can be different shapes. Note that I can't check if only the first and last point of the Red Line is inside the Blue Node (see the image -> it should fail in such case because Red Line is NOT completely over the Blue Node).

enter image description here



from KonvaJS - how to check if Line is inside other Node

No comments:

Post a Comment