anseki / plain-draggable

The simple and high performance library to allow HTML/SVG element to be dragged.
https://anseki.github.io/plain-draggable/
MIT License
765 stars 96 forks source link

Draggable collision #136

Closed rdimaunahan closed 1 year ago

rdimaunahan commented 1 year ago

Hi anseki! I just want to as if there is a way to make the draggable objects not overlap with other draggable object when being dragged across the workspace?

anseki commented 1 year ago

Hi @rdimaunahan, thank you for the comment. You can use onDrag event listener to check it and dodge other elements.

rdimaunahan commented 1 year ago

Do you mind showing an example to do so?

anseki commented 1 year ago

See this example: https://anseki.github.io/plain-draggable/#ex-040-stage The draggable element dodges another element that looks like an island. And, the next example with LeaderLine works the same as the first example. The second example is easier than the first one because that doesn't have curve lines.

anseki commented 1 year ago

No reply came, then this abandoned issue is closed.