From c358cba0c5aa9751f319859d174953fad31fc51c Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Tue, 9 Sep 2025 15:41:10 +0900 Subject: [PATCH 1/3] =?UTF-8?q?=ED=9D=A1=EC=B0=A9=EC=A0=90=20points=20=3D>?= =?UTF-8?q?=20getCurrentPoints()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/useEvent.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hooks/useEvent.js b/src/hooks/useEvent.js index 748e680a..dfbe492c 100644 --- a/src/hooks/useEvent.js +++ b/src/hooks/useEvent.js @@ -129,7 +129,7 @@ export function useEvent() { let arrivalPoint = { x: pointer.x, y: pointer.y } if (adsorptionPointMode) { - const roofsPoints = roofs.map((roof) => roof.points).flat() + const roofsPoints = roofs.map((roof) => roof.getCurrentPoints()).flat() roofAdsorptionPoints.current = [...roofsPoints] const auxiliaryLines = canvas.getObjects().filter((obj) => obj.name === 'auxiliaryLine') From a183453390d9c6d1f8f1ba1c69e5000a226231a2 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Wed, 10 Sep 2025 14:33:53 +0900 Subject: [PATCH 2/3] =?UTF-8?q?A,B=ED=83=80=EC=9E=85=20=EC=A7=80=EB=B6=95?= =?UTF-8?q?=20=EB=8C=80=EC=9D=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/usePolygon.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/hooks/usePolygon.js b/src/hooks/usePolygon.js index a1cbc4f0..2ae37440 100644 --- a/src/hooks/usePolygon.js +++ b/src/hooks/usePolygon.js @@ -852,7 +852,10 @@ export const usePolygon = () => { if (checkLineOverlap(innerLine, polygonLine)) { // innerLine의 type을 polygonLine의 type으로 변경 if (innerLine.attributes && polygonLine.attributes.type) { - // polygonLine.need = false + // innerLine이 polygonLine보다 긴 경우 polygonLine.need를 false로 변경 + if (polygonLine.length < innerLine.length) { + polygonLine.need = false + } innerLine.attributes.planeSize = innerLine.attributes.planeSize ?? polygonLine.attributes.planeSize innerLine.attributes.actualSize = innerLine.attributes.actualSize ?? polygonLine.attributes.actualSize innerLine.attributes.type = polygonLine.attributes.type @@ -1008,6 +1011,9 @@ export const usePolygon = () => { /*const originInnerStroke = innerLine.stroke innerLine.set({ stroke: 'red' }) canvas.renderAll()*/ + if (checkLineOverlap(line, innerLine)) { + return + } if (isPointOnLine(line, innerLine.startPoint)) { canvas.renderAll() if (isSamePoint(line.startPoint, innerLine.startPoint) || isSamePoint(line.endPoint, innerLine.startPoint)) { From 3811f224d6952d28d4d4074e555190ba2612ba6c Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Wed, 10 Sep 2025 17:51:07 +0900 Subject: [PATCH 3/3] =?UTF-8?q?plan=20=EC=A0=80=EC=9E=A5=20=EC=A0=84=20?= =?UTF-8?q?=EC=84=A0=ED=83=9D=ED=95=9C=20setupsurface=20=EC=84=A0=ED=83=9D?= =?UTF-8?q?=EB=90=9C=20=EA=B2=BD=EC=9A=B0=20=EC=B4=88=EA=B8=B0=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/usePlan.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/hooks/usePlan.js b/src/hooks/usePlan.js index ba8776d4..cdb02fef 100644 --- a/src/hooks/usePlan.js +++ b/src/hooks/usePlan.js @@ -173,6 +173,13 @@ export function usePlan(params = {}) { * @param {boolean} saveAlert - 저장 완료 알림 표시 여부 */ const saveCanvas = async (saveAlert = true) => { + // 저장 전 선택되어 있는 object 제거 + const setupSurfaces = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE) + + setupSurfaces.forEach((surface) => { + surface.set({ fill: 'rgba(255,255,255,0.1)', strokeDashArray: [10, 4], strokeWidth: 1 }) + }) + const canvasStatus = currentCanvasData('save') const result = await putCanvasStatus(canvasStatus, saveAlert) //캔버스 저장 완료 후