From fb9c6e1de5394f6ea6af98b0439d744732ceb3ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Sun, 8 Mar 2026 00:34:11 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20[planning-design]=20Ctrl+X=20=ED=9B=84?= =?UTF-8?q?=20Ctrl+Z=20=EB=B3=B5=EA=B5=AC=20=EC=95=88=20=EB=90=98=EB=8A=94?= =?UTF-8?q?=20=EB=AC=B8=EC=A0=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/views/rd/planning-design/index.blade.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/resources/views/rd/planning-design/index.blade.php b/resources/views/rd/planning-design/index.blade.php index 1bf71073..81d7d037 100644 --- a/resources/views/rd/planning-design/index.blade.php +++ b/resources/views/rd/planning-design/index.blade.php @@ -3278,21 +3278,24 @@ function planningCanvas() { }, sbUndo() { - if (this._sbHistoryIdx <= 0) return; + if (this._sbHistory.length === 0) return; const page = this.sbCurrentPage; if (!page) return; - // 처음 undo 시 현재 상태 저장 + // 처음 undo 시 현재(변경 후) 상태를 히스토리 끝에 저장 + const curSnap = JSON.parse(JSON.stringify(page.blocks || [])); if (this._sbHistoryIdx === this._sbHistory.length - 1) { - const snap = JSON.parse(JSON.stringify(page.blocks || [])); - if (this._sbHistory.length === 0 || JSON.stringify(this._sbHistory[this._sbHistoryIdx]) !== JSON.stringify(snap)) { - this._sbHistory.push(snap); + const lastSnap = JSON.stringify(this._sbHistory[this._sbHistoryIdx]); + if (lastSnap !== JSON.stringify(curSnap)) { + this._sbHistory.push(curSnap); this._sbHistoryIdx = this._sbHistory.length - 1; } } + if (this._sbHistoryIdx <= 0) return; this._sbHistoryIdx--; this._sbHistoryPaused = true; page.blocks = JSON.parse(JSON.stringify(this._sbHistory[this._sbHistoryIdx])); this.sbSelectedBlock = null; + this.sbMultiSelected = []; this._sbHistoryPaused = false; this.autoSave(); }, @@ -3304,6 +3307,7 @@ function planningCanvas() { this._sbHistoryIdx++; this._sbHistoryPaused = true; page.blocks = JSON.parse(JSON.stringify(this._sbHistory[this._sbHistoryIdx])); + this.sbMultiSelected = []; this.sbSelectedBlock = null; this._sbHistoryPaused = false; this.autoSave();