pure-canvas
Advanced tools
Comparing version 0.5.3 to 0.5.4
@@ -19,2 +19,7 @@ "use strict"; | ||
} | ||
LayerCached.prototype.invalidateAll = function () { | ||
this.invalidateBuffer(); | ||
this.invalidateIndex(); | ||
this.invalidateBounds(); | ||
}; | ||
LayerCached.prototype.invalidateBuffer = function () { | ||
@@ -109,2 +114,14 @@ this.cache = undefined; | ||
}; | ||
LayerCached.prototype.add = function (node) { | ||
this.invalidateAll(); | ||
return _super.prototype.add.call(this, node); | ||
}; | ||
LayerCached.prototype.remove = function (a) { | ||
this.invalidateAll(); | ||
_super.prototype.remove.call(this, a); | ||
}; | ||
LayerCached.prototype.removeAll = function () { | ||
this.invalidateAll(); | ||
_super.prototype.removeAll.call(this); | ||
}; | ||
return LayerCached; | ||
@@ -111,0 +128,0 @@ }(Layer_1.default)); |
{ | ||
"name": "pure-canvas", | ||
"version": "0.5.3", | ||
"version": "0.5.4", | ||
"description": "TODO", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -5,2 +5,3 @@ import Node, {Bounds, Point} from './Node'; | ||
import TreeManager from './TreeManager'; | ||
import NodeIndexable from './NodeIndexable'; | ||
@@ -27,2 +28,8 @@ const emptyTransformers: Array<Transformer> = []; | ||
invalidateAll(): void { | ||
this.invalidateBuffer(); | ||
this.invalidateIndex(); | ||
this.invalidateBounds(); | ||
} | ||
invalidateBuffer(): void { | ||
@@ -122,2 +129,17 @@ this.cache = undefined; | ||
} | ||
add(node: NodeIndexable): number { | ||
this.invalidateAll(); | ||
return super.add(node); | ||
} | ||
remove(a: number | NodeIndexable): void { | ||
this.invalidateAll(); | ||
super.remove(a); | ||
} | ||
removeAll(): void { | ||
this.invalidateAll(); | ||
super.removeAll(); | ||
} | ||
}; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
210923
2689