freegroup / draw2d

Create Visio like drawings, diagrams or workflows with JavaScript and HTML5
https://freegroup.github.io/draw2d/#/examples
MIT License
738 stars 227 forks source link

Scroll canvas while dragging or connect nodes #156

Open Samanoova opened 3 years ago

Samanoova commented 3 years ago

Hi is there any feature od what is the best way to make it when I have a large draw and many shapes and want to make it smooth to move shapes and connect between them by making an auto-scrolling while dragging the shapes

something like the video but more smooth I mean without stopping the node like a fixed position element while scrolling and I want to make canvas size grow as required (unlimited size and grow as you scroll)

kleins05 commented 3 years ago

I would like to second this request. I managed to autoscroll the canvas by watching the mousemove event and adjusting scrollLeft / scrollTop. But if I do so, the drag operation breaks, the dragged object kind of lags behind, the cursor is not on the object anymore. Looks like coordinate calculation of the drag operation somehow gets messed up by my interfering with the scroll position during drag.

Samanoova commented 3 years ago

we cant fire a drag event with the same values of scrolling or something?

ganeshpatwaypi commented 2 years ago

@Samanoova i am looking for the same have you found solution?

Samanoova commented 2 years ago

@ganeshpatwaypi I wrote my own custom function for that but still don't working on connection it's working with shapes only

snakex64 commented 1 year ago

Bump on this, it is kind of problematic for bigger canvas since this is an issue that happens very often