Kinetic.Node.moveTo() now checks if the node is already a child of the target container before removing it from the current container and adding it to the target container.

This commit is contained in:
Matthew Hasbach
2014-07-27 21:37:50 -04:00
parent d8a429ac85
commit 6fc5019f04

View File

@@ -1031,8 +1031,10 @@
* node.moveTo(layer2);
*/
moveTo: function(newContainer) {
Kinetic.Node.prototype.remove.call(this);
if (this.getParent() !== newContainer) {
this.remove();
newContainer.add(this);
}
return this;
},
/**