Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added added/removed events to fabric.Group #4569 #4570

Closed
wants to merge 1 commit into from

Conversation

wferris722
Copy link

@wferris722 wferris722 commented Dec 19, 2017

Resolves #4569 by adding required code for firing events to _onObjectAdded and _onObjectRemoved

while (this._objects.length){
this.remove(this._objects[0]);
}
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this and the automatic event binding are not part of the PR description.
Also this has a problem:
if you put a group inside a group, when you remove the group from the outside group, this will loose all objects.

@asturur
Copy link
Member

asturur commented Dec 19, 2017

i'm not sure about this change.
For sure the automatic event binding on group initialize is something we do not want

@wferris722
Copy link
Author

wferris722 commented Dec 19, 2017

You're right, I'll modify the PR to limit it to _onObjectAdded and _onObjectRemoved, and get rid of the automatic event binding and removing subobjects from the group.

I was thinking of the added/removed event as being added/removed from the canvas rather than the object that contained it, which was wrong. It also causes the problem you mentioned above.

@wferris722 wferris722 closed this Apr 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants