I'm just starting with KineticJS, and as in the title, I can't add a shape to a layer if that layer is already added to the stage. This is probably for a reason, but I'd like to understand why.
This works:
var stage = new Kinetic.Stage({container: 'canvas', width:200, height:200});
var layer = new Kinetic.Layer();
var shape = new Kinetic.Wedge({x: 50, y: 50, radius: 30, angle: 60, fill: 'red'});
layer.add(shape);
stage.add(layer);
This doesn't:
var stage = new Kinetic.Stage({container: 'canvas', width:200, height:200});
var layer = new Kinetic.Layer();
stage.add(layer);
var wedge = new Kinetic.Wedge({x: 50, y: 50, radius: 30, angle: 60, fill: 'red'});
layer.add(wedge);