Skip to content

Commit b06dd44

Browse files
committed
fix: fix for shapes used as N view (like Span)
1 parent abecb5c commit b06dd44

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/shapes/shape.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,13 @@ export default abstract class Shape extends Observable {
196196
return this.mPaint;
197197
}
198198

199+
set parent(value) {
200+
this.mParent = new WeakRef(value);
201+
}
202+
get parent() {
203+
return this.mParent?.get();
204+
}
205+
199206
id: string;
200207
toString() {
201208
return `[${this.constructor.name}]${this.id ? `<${this.id}>` : ''}`;

0 commit comments

Comments
 (0)