Replies: 1 comment
-
Did you try to use group? On drag end, detect if dragged shape is above "frame", if so, calcualate relative position to the "frame group", add the shape into the group, adjust position. Make whole "frame group" draggable, so you can move whole frame. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I recently found this library and I am amazed of how feature rich it is.
I am trying to achieve something, but still I am experiencing difficulties doing so.
What my goal is - I want to have the possibility to create frame (something like container), where I can drag-in or drag-out items. But I want to have the possibility to move the whole container when I select it (including all items inside).
Here is what I am trying to achieve:
As shown in the gif below, I want to stack items inside the frame (which is just a rectangle with stroke). Then I want to move the frame, but also all the inner objects to move as well.
Also using the rect as a frame, causes some issues, because it appears on top of the other objects inside (the red frame on the demo).
https://jsfiddle.net/tobieski/84jksoue/1/
My question is - is there a good way to achieve frame like this ?
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions