-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
fix(Group): patch2 minors #7916
Conversation
replace #7900 |
Code Coverage Summary
|
Code Coverage Summary
|
Code Coverage Summary
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is much better no doubt.
However:
The advantage of moving it to add/insertAt is clear. That's how it should be. The disadvantage is a drop in perf for large groups because we add an iteration over objects. Unless we manage to change collection logic to run all logic on object in one single iteration
Originally posted by @ShaMan123 in #7900 (comment)
But I think we should move forward
Could you explain why Layer will take time to merge into master? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because i have seen the PR, and i don't like the idea of having special logic to allow layers to react to both canvas and group container. I want to simplify things not make more complicated. The layer per se is ok, a dimensionless group always interactive. fine. |
The only large group i know of is the spray brush, can you think of others? |
I guess you are right. I don't use huge groups in my projects. |
This next? Don't forget my review |
Code Coverage Summary
|
Applied fixes and merging |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about insertAt
- we should filter that as well
if (object === this || this.isDescendantOf(object)) { | ||
/* _DEV_MODE_START_ */ | ||
console.warn('fabric.Group: trying to add group to itself, this call has no effect'); | ||
console.error('fabric.Group: trying to add group to itself, this call has no effect'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so we should only warn now, right?
This PR rename canEnter in canEnterGroup and move canEnterGroup to an higher level of the logic so that it can stops adding not supported objects to groups.
Background color has been left in for group since the layers in group concept may be slow to enter fabricjs.