From f4f885dda9e48c1c3bfdc295032fbeddc552244f Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Mon, 23 Dec 2024 10:25:31 +0900 Subject: [PATCH] =?UTF-8?q?86er1b9x1=20-=20=EC=A7=80=EB=B6=95=ED=98=95?= =?UTF-8?q?=EC=83=81=20=EC=84=A4=EC=A0=95=20-=20=EB=B3=80=EB=B3=84?= =?UTF-8?q?=EB=A1=9C=20=EC=84=A4=EC=A0=95=20=EC=A0=81=EC=9A=A9=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/roofcover/useRoofShapeSetting.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/hooks/roofcover/useRoofShapeSetting.js b/src/hooks/roofcover/useRoofShapeSetting.js index c26c61ec..69309248 100644 --- a/src/hooks/roofcover/useRoofShapeSetting.js +++ b/src/hooks/roofcover/useRoofShapeSetting.js @@ -595,17 +595,23 @@ export function useRoofShapeSetting(id) { break } } - selectedLine.attributes = attributes - history.current.push(selectedLine) + selectedLine.attributes = { ...attributes, isFixed: true } + canvas.renderAll() nextLineFocus(selectedLine) } const nextLineFocus = (selectedLine) => { const lines = canvas.getObjects().filter((obj) => obj.name === 'outerLine') + const index = lines.findIndex((line) => line.idx === selectedLine.idx) const nextLine = lines[index + 1] || lines[0] + if (nextLine.attributes.isFixed) { + canvas.discardActiveObject() + return + } + history.current.push(selectedLine) canvas.setActiveObject(nextLine) }