-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
feat(Group): 2nd Patch of New Group! 🎉 #7859
Conversation
in case object is a collection
have fun. |
tasks: before merging:i need to figure out why isInFrontOf cant't reuse findCommonAncestors. it has to. after merging:verify edge case with this._objectsToRender invalidation |
You made me laugh aloud. A damn riddle it is. Sorry!
I have changed collection 3ec53b4 |
The discussion is getting hectic. |
updated description |
the only thing to do is me to dig isFrontOf, i have seen there are a lot of tests done so i can probably just use those to test my assumptions. For add and remove, i just want to change so that they behave same, they return what they need to return, but they return the same thing. ( both the length, or the list of added remove objects, or both true / false ) |
I can now offer a mature explanation as to where your logic is missing. |
I am satisfied with the explanation. Are you? |
i spent 30 minutes changing the function as i see it fit, then stuck hours to make the test pass. Something makes the deepEquals fails for me, even when those are identical. |
I pushed up my branch |
@asturur can we merge this and then PR a dedicated change? I really want/need to move forward. And working between branches with merge conflicts is a horror.
|
opened #7900 for minors |
@asturur I have encountered an inconsistency I would like to fix. let obj;
obj.on('removed', opt => {
obj.canvas // still referenced
obj.group // not referenced
let parent = opt.target // group or canvas
})
canvas.add(obj);
canvas.remove(obj);
group.add(obj);
group.remove(obj); |
because of the naming |
Code Coverage Summary
|
i should be able to merge this tomorrow morning. |
Great. Do you plan on merging #7900 first or right after? |
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.
I ll follow up with add/remove/insertAt ( maybe insertAt can be removed? ) consistency chnages and i need to check that getTransformedDimensions overrides.
Need to get a good run to the master branch, this is a first very large change also in behaviour |
Excellent! A big step forward! Many thanks for your work Andrea. |
This PR makes nested selection work out of the box.
Group's selection observers are now almost completely redundant (d8f8251) if I am not mistaken. The only use I can think of is when active object is not active selection. Consider using
canvas.getActiveObjects().includes(obj)
instead.Logic has been adapted and now active selection almost completely supports selecting nesting objects (multiple selection is handled by #7882 ) I believe the only thing from perfect impl is
containsPoint
To Do - done on #7900
canEnter
- feat(Group): 2nd Patch of New Group! 🎉 #7859 (comment)text.class
feat(Group): 2nd Patch of New Group! 🎉 #7859 (comment) - this can be removed only if group set coords on it's object. The question is what would be less damaging to perf... leaving as is or setting coords on all nested objects? Or a third option would be for group to check if object is on screen before it renders itcontainsPoint
should be calculated relative to canvas coordinate plane@asturur
isInFrontOf
Changed Files
src/brushes/spray_brush.class.js
- adapt to new groupsrc/canvas.class.js
- return top most target including sub targets in case target is interactivesrc/mixins/animation.mixin.js
- fix animations to be relative to canvassrc/mixins/canvas_events.mixin.js
- port missing logic from v6!src/mixins/canvas_grouping.mixin.js
- port missing logic from v6! accounting for nested objectssrc/mixins/eraser_brush.mixin.js
- adapt to new group (follow up will be in a separate PR)src/mixins/itext_behavior.mixin.js
- add/remove handlers from canvas events (not group)src/mixins/itext_click_behavior.mixin.js
- enable text editing under groupsrc/mixins/object_ancestry.mixin.js
- port logic from v6!src/mixins/object_geometry.mixin.js
- port logic from v6!src/mixins/object_stacking.mixin.js
- exposedisInFrontOf
to determine which object is in front of the other in the entire treesrc/shapes/active_selection.class.js
- adapt to restore objects to their owning groupsrc/shapes/group.class.js
- tidy code for easier subclassing + supportbackgroundColor
src/static_canvas.class.js
test/unit/group.js
- fix failing testtest/unit/itext_click_behaviour.js
- adapt tests for nested itexttest/unit/object.js
isDescendantOf
findCommonAncestors
isInFrontOf
test/visual/group_layout.js
- reactivate testsThings Left Out
Layer
- created a dedicated PR for it feat(Layer): 3rd Patch of Group Rewrite ♦️ #7860src/mixins/canvas_grouping
- I suspect it needs additional work. Committed some fixes and dumped the file from v6!.Group#_renderObjects
- we need to discuss this, opened dedicated PR feat(Group): render selected objects #7863