Hi,
I have a strange behaviour when i try to set the cloned group as the active group.
http://jsfiddle.net/NuE78/62/
Step to reproduce :
Actual result : empty group if you use "setActiveGroup()" on the cloned object.
The group is empty if i use "setActiveGroup()" on line 52. If you comment this line the group is correctly displayed.
PS : I could set "active=true" directly on my cloned group to bypass this problem but i don't understand why setActiveGroup is not working fine, so it's perhaps a bug.
Ok i think i understand, as the group is now a single object (with 2 sub-objects), i need to use setActiveObject() and not setActiveGroup().
Let me know if you want to close this ticket or if a hardening of the code will be added.
Yes if you creat a group to add to canvas you need to use setActiveObject.
I m guessing if we should have a setMultiSelection method or similar, and hide setActiveGroup that is useless and confusing.
activeGroup is the multi selection and nothing else, calling it does not make what it should make happen, while if we would have a setMultiSelection to which we pass an array of objects or multiple objects that make all the dirty job, maybe people would stop being confused.
Yes the name of the function is a bit confusing.
To have a new name function could be a good thing.
Its sad I had to figure out @asturur 's answer myself.
OMG I spend more than 4 hours banging my head and debugging to find out why my programmatically created group is empty when resized!!!!
Until I find out its the setAciveGroup method that couseing the problem, and I was about to file a bug report that I saw this ...
the name setAciveGroup is very confusing, one thinks that when you do group = new fabric.Group(), you should also do setActiveGroup(group) !!!
this is fixed with the new api and docs, even if not finished they cover the arguments.
Most helpful comment
Yes if you creat a group to add to canvas you need to use setActiveObject.
I m guessing if we should have a
setMultiSelectionmethod or similar, and hide setActiveGroup that is useless and confusing.activeGroup is the multi selection and nothing else, calling it does not make what it should make happen, while if we would have a setMultiSelection to which we pass an array of objects or multiple objects that make all the dirty job, maybe people would stop being confused.