mirror of
https://github.com/konvajs/konva.git
synced 2025-12-05 03:24:23 +08:00
fixed bug related to multiple removals of same node
This commit is contained in:
14
src/Stage.js
14
src/Stage.js
@@ -166,8 +166,7 @@ Kinetic.Stage.prototype = {
|
||||
// then revert to previous no-parameter image/png behavior
|
||||
callback(bufferLayer.getCanvas().toDataURL(mimeType, quality));
|
||||
}
|
||||
catch(exception)
|
||||
{
|
||||
catch(exception) {
|
||||
callback(bufferLayer.getCanvas().toDataURL());
|
||||
}
|
||||
}
|
||||
@@ -183,8 +182,15 @@ Kinetic.Stage.prototype = {
|
||||
* @param {Layer} layer
|
||||
*/
|
||||
remove: function(layer) {
|
||||
// remove layer canvas from dom
|
||||
this.content.removeChild(layer.canvas);
|
||||
/*
|
||||
* remove canvas DOM from the document if
|
||||
* it exists
|
||||
*/
|
||||
try {
|
||||
this.content.removeChild(layer.canvas);
|
||||
}
|
||||
catch(e) {
|
||||
}
|
||||
this._remove(layer);
|
||||
},
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user