Reputation: 1804
Is there a way to make the "move" listener fire when the object is moved as part of a selection?
rect2 = new fabric.Rect(
left: 150
top: 10
fill: "green"
width: 20
height: 20
)
# Red&Green Rect: When moving "green", event fires, when moving both, it does not
rect2.on "moving", ->
#Only fires when the object is moved on it´s own :(
jsFiddle -> http://jsfiddle.net/thomasf1/mJjH6/2/
Upvotes: 3
Views: 1878
Reputation: 133
You can access all group objects via event.target._objects
in canvas object:moving
event. Note that fabric does not change child coordinates when moving group, so you should add child left coordinate to group left coordinate to get real left position.
Look at my jsFiddle example
Upvotes: 3