diff --git a/src/BaseLayer.js b/src/BaseLayer.js index 21297ef4..976da280 100644 --- a/src/BaseLayer.js +++ b/src/BaseLayer.js @@ -51,7 +51,6 @@ */ clear: function(bounds) { this.getContext().clear(bounds); - this.getHitCanvas().getContext().clear(bounds); return this; }, clearHitCache: function() { diff --git a/src/FastLayer.js b/src/FastLayer.js index 9b75020e..f349ca9b 100644 --- a/src/FastLayer.js +++ b/src/FastLayer.js @@ -47,28 +47,6 @@ this.drawScene(); return this; }, - /** - * clear scene and hit canvas contexts tied to the layer - * @method - * @memberof Konva.FastLayer.prototype - * @param {Object} [bounds] - * @param {Number} [bounds.x] - * @param {Number} [bounds.y] - * @param {Number} [bounds.width] - * @param {Number} [bounds.height] - * @example - * layer.clear(); - * layer.clear({ - * x : 0, - * y : 0, - * width : 100, - * height : 100 - * }); - */ - clear: function(bounds) { - this.getContext().clear(bounds); - return this; - }, // extend Node.prototype.setVisible setVisible: function(visible) { Konva.Node.prototype.setVisible.call(this, visible); diff --git a/src/Layer.js b/src/Layer.js index 4304cd13..23869e5b 100644 --- a/src/Layer.js +++ b/src/Layer.js @@ -180,26 +180,8 @@ this.imageData = null; // Clear imageData cache return this; }, - /** - * clear scene and hit canvas contexts tied to the layer - * @method - * @memberof Konva.Layer.prototype - * @param {Object} [bounds] - * @param {Number} [bounds.x] - * @param {Number} [bounds.y] - * @param {Number} [bounds.width] - * @param {Number} [bounds.height] - * @example - * layer.clear(); - * layer.clear({ - * x : 0, - * y : 0, - * width : 100, - * height : 100 - * }); - */ clear: function(bounds) { - this.getContext().clear(bounds); + Konva.BaseLayer.prototype.clear.call(this, bounds); this.getHitCanvas().getContext().clear(bounds); this.imageData = null; // Clear getImageData cache return this;