I'm playing with Kinetic and can't seem to figure out why a group I'm cloning won't appear.
Fiddle: http://jsfiddle.net/DgwLd/3/
I can clone shapes no problem - it's just groups that don't appear. The documentation confirms that groups can be cloned, so I'm not sure what's up here. Here's the code from the Fiddle:
//group and original circle - appears fine
layer.add(new Kinetic.Group({id: 'group'}));
stage.get('#group')[0].add(new Kinetic.Circle({
fill: 'orange',
x: 200,
y: 50,
radius: 30
}));
//clone of group at different Y pos - doesn't appear
layer.add(stage.get('#group')[0].clone({y: 120}));
UPDATE - it seems cloning a group doesn't make a deep copy. This is verifiable by console logging the group - console.log(stage.get('#group2'))
and you'll see its children
collection is empty). Is this a bug? Not sure why you'd ever want to clone a group without its constituents.
Any thoughts? Thanks in advance.