移除容器前判断父元素是否存在
This commit is contained in:
parent
729a3c25b4
commit
65f8e53e6b
@ -102,7 +102,9 @@ export abstract class GraphicDrawAssistant<
|
|||||||
unbind(): void {
|
unbind(): void {
|
||||||
this.clearCache();
|
this.clearCache();
|
||||||
const canvas = this.canvas;
|
const canvas = this.canvas;
|
||||||
|
if (this.container?.parent) {
|
||||||
canvas.removeChild(this.container);
|
canvas.removeChild(this.container);
|
||||||
|
}
|
||||||
canvas.off('mousedown', this.onLeftDown, this);
|
canvas.off('mousedown', this.onLeftDown, this);
|
||||||
canvas.off('mousemove', this.onMouseMove, this);
|
canvas.off('mousemove', this.onMouseMove, this);
|
||||||
canvas.off('mouseup', this.onLeftUp, this);
|
canvas.off('mouseup', this.onLeftUp, this);
|
||||||
|
Loading…
Reference in New Issue
Block a user