-
-
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
Add object to nested group #6738
Comments
Actually does Fabric already has a support of nested groups? |
yes nested groups are ok. |
@asturur thank you for quick response, I use addWithUpdate(rect6), and call addWithUpdate() on the outer group. it still doesn't work. (nested group's position change incorrectly), am i doing it wrong, could you please check it here. click AddNode Error and check it. Thanks a lot! |
Ok this is definitely broken i need to fix it. |
I repopend my PR for this, i need a moment to recap what i did, and we can fix this. |
Hi, I use fabric's group recently, I understand when you want to add object to group and update it, you can use addWithUpdate, it works great when when the group is just under canvas.
like that: canvas->group works
but when the group(group1) is under another group, it doesn't work anymore, group and it's object's position will be wrong after use addWithUpdate
canvas->group->group1 does not work
check it here
https://jsfiddle.net/zhongjian2008/0re3hjyp/16/
Now i find a workaround it before add object to group in other group, ungroup it first, then group them back. but when there is many group, in deep structure, it makes things complex.
This issue is relate use ActiveSelection to group multi objects that already under a group or deep group.
canvas->group->group01(node1, node2)
->group1->group02(node3, node4)
var sel = new fabric.ActiveSelection([node1, node3]); // does not work
canvas.setActiveObject(sel);
canvas.requestRenderAll();
Is there any other solution? thanks a lot.
The text was updated successfully, but these errors were encountered: