diff --git a/src/Node.ts b/src/Node.ts index 765bc47d..d12ec441 100644 --- a/src/Node.ts +++ b/src/Node.ts @@ -1211,6 +1211,9 @@ export abstract class Node { this.attrs.x = origTrans.x; this.attrs.y = origTrans.y; + delete origTrans.x; + delete origTrans.y; + // important, use non cached value this._clearCache(TRANSFORM); var it = this._getAbsoluteTransform().copy(); diff --git a/src/Shape.ts b/src/Shape.ts index 9b66a95b..6d69f14a 100644 --- a/src/Shape.ts +++ b/src/Shape.ts @@ -185,7 +185,7 @@ export class Shape< Config extends ShapeConfig = ShapeConfig > extends Node { _centroid: boolean; - colorKey: string; + colorKey?: string; _fillFunc: (ctx: Context) => FillFuncOutput; _strokeFunc: (ctx: Context) => void; @@ -455,7 +455,8 @@ export class Shape< destroy() { Node.prototype.destroy.call(this); - delete shapes[this.colorKey]; + delete shapes[this.colorKey!]; + delete this.colorKey; return this; } // why do we need buffer canvas?