jerosoler / Drawflow

Simple flow library 🖥️🖱️
https://jerosoler.github.io/Drawflow/
MIT License
4.78k stars 741 forks source link

Create mouse selection box #522

Closed maxkaoppp closed 1 year ago

maxkaoppp commented 2 years ago

hello @jerosoler ,I want to create the rectangle box with mouse drag and copy selected node.How can I do that? Just like the image below. image

jerosoler commented 2 years ago

For default library not support multiple select. You can see here some solutions:

To be able to do it you need to detect the collisions, it can be achieved with this method: https://developer.mozilla.org/en-US/docs/Games/Techniques/2D_collision_detection

You just have to have the sizes of the drawn box and the size of your nodes.