Nimish Jain
Nimish Jain

Reputation: 97

paperjs: drag two items in one go without changing their relative position

Which functionality of paperjs should I use so that two items can be dragged in one go without changing their relative position i.e. both the items should move irrespective of which item I am dragging. I have tried doing it with group but it doesn't work. I don't want to make it a compound path either because I want to join/combine two or more items dynamically for dragging purpose.

sketch link

In the given sketch, one end of line coincides with the center of circle. Now whether I drag Circle or Line, both the items should move without changing their relative position.

Upvotes: 0

Views: 224

Answers (1)

arthur.sw
arthur.sw

Reputation: 11659

Groups are designed for this purpose, here is a working example.

Upvotes: 1

Related Questions