From fae362235e1e8a13343bcd105b1e9ebe7554d54f Mon Sep 17 00:00:00 2001 From: MinHo Lim Date: Wed, 20 Aug 2025 15:49:50 +0900 Subject: [PATCH 1/2] fix register selection position --- src/patchmap.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/patchmap.js b/src/patchmap.js index 4b90d455..474e962b 100644 --- a/src/patchmap.js +++ b/src/patchmap.js @@ -127,6 +127,7 @@ class Patchmap { this._resizeObserver = initResizeObserver(element, this.app, this.viewport); this._stateManager = new StateManager(this); + this._stateManager.register('selection', SelectionState, true); this.isInit = true; } @@ -149,6 +150,7 @@ class Patchmap { this._theme = themeStore(); this._undoRedoManager = new UndoRedoManager(); this._animationContext = gsap.context(() => {}); + this.stateManager.resetState(); } draw(data) { @@ -170,7 +172,6 @@ class Patchmap { this.animationContext.revert(); event.removeAllEvent(this.viewport); draw(context, validatedData); - this._stateManager.register('selection', SelectionState, true); // Force a refresh of all relation elements after the initial draw. This ensures // that all link targets exist in the scene graph before the relations From 1f86697558e3008e9e7bc815de0c9b6f818e5712 Mon Sep 17 00:00:00 2001 From: MinHo Lim Date: Wed, 20 Aug 2025 15:59:19 +0900 Subject: [PATCH 2/2] fix --- src/patchmap.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/patchmap.js b/src/patchmap.js index 5ea6a8eb..2173da4a 100644 --- a/src/patchmap.js +++ b/src/patchmap.js @@ -138,6 +138,7 @@ class Patchmap { this.undoRedoManager.destroy(); this.animationContext.revert(); + this.stateManager.resetState(); event.removeAllEvent(this.viewport); this.viewport.destroy({ children: true, context: true, style: true }); const parentElement = this.app.canvas.parentElement; @@ -152,7 +153,6 @@ class Patchmap { this._theme = themeStore(); this._undoRedoManager = new UndoRedoManager(); this._animationContext = gsap.context(() => {}); - this.stateManager.resetState(); this._transformer = null; }