From 456ec7643e6e4a2befb2e0e9a4cc2af005e3c1a2 Mon Sep 17 00:00:00 2001 From: ysCha Date: Wed, 24 Dec 2025 14:13:30 +0900 Subject: [PATCH] =?UTF-8?q?=EC=A0=84=EC=B2=B4=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/useContextMenu.js | 6 ++++++ src/util/skeleton-utils.js | 25 +++++++++++++------------ 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/src/hooks/useContextMenu.js b/src/hooks/useContextMenu.js index a863fd01..1f6a33b0 100644 --- a/src/hooks/useContextMenu.js +++ b/src/hooks/useContextMenu.js @@ -355,6 +355,12 @@ export function useContextMenu() { canvas.remove(line) }) + //동이동현이동 + const eaveHelpLines = canvas.getObjects().filter((obj) => obj.name === 'eaveHelpLine' && obj.parentId === currentObject.attributes.roofId) + eaveHelpLines.forEach((line) => { + canvas.remove(line) + }) + canvas.renderAll() }, }, diff --git a/src/util/skeleton-utils.js b/src/util/skeleton-utils.js index 943f1f38..da15751c 100644 --- a/src/util/skeleton-utils.js +++ b/src/util/skeleton-utils.js @@ -677,8 +677,9 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => { // 조건에 맞는 라인들만 필터링 const validWallLines = [...wallLines].sort((a, b) => a.idx - b.idx).filter((wallLine, index) => wallLine.idx - 1 === index) - console.log('', sortRoofLines, sortWallLines, sortWallBaseLines) - sortWallLines.length > 3 && + console.log('', sortRoofLines, sortWallLines, sortWallBaseLines); + + (sortWallLines.length === sortWallBaseLines.length && sortWallBaseLines.length > 3) && sortWallLines.forEach((wallLine, index) => { const roofLine = sortRoofLines[index] @@ -1056,8 +1057,8 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => { if (isStartEnd.end) { const moveDist = Big(wallLine.x1).minus(wallBaseLine.x1).abs().toNumber() - const aStartY = Big(roofLine.y2).minus(moveDist).abs().toNumber() - const bStartY = Big(wallLine.y2).minus(moveDist).abs().toNumber() + const aStartY = Big(roofLine.y2).minus(moveDist).toNumber() + const bStartY = Big(wallLine.y2).minus(moveDist).toNumber() const inLine = findLineContainingPoint(innerLines, { y: aStartY, x: roofLine.x1 }) console.log('startLines:::::::', inLine) const eLineY = Big(bStartY).minus(wallLine.y2).abs().toNumber() @@ -1167,7 +1168,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => { const newPointY = Big(roofLine.y1).plus(moveDist).toNumber() const pDist = Big(wallLine.y1).minus(roofLine.y1).abs().toNumber() - const pLineX = Big(roofLine.x2).minus(0).abs().toNumber() + const pLineX = Big(roofLine.x2).minus(0).toNumber() // let idx = sortRoofLines.length < index + 1 ? 0 : index // const pLineY = sortRoofLines[idx + 1].y2 @@ -1243,11 +1244,11 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => { } if (isStartEnd.end) { const moveDist = Big(wallLine.y1).minus(wallBaseLine.y1).abs().toNumber() - const aStartX = Big(roofLine.x2).minus(moveDist).abs().toNumber() - const bStartX = Big(wallLine.x2).minus(moveDist).abs().toNumber() + const aStartX = Big(roofLine.x2).minus(moveDist).toNumber() + const bStartX = Big(wallLine.x2).minus(moveDist).toNumber() const inLine = findLineContainingPoint(innerLines, { x: aStartX, y: newPEnd.y }) console.log('startLines:::::::', inLine) - const eLineX = Big(bStartX).minus(wallLine.x2).abs().toNumber() + const eLineX = Big(bStartX).minus(wallLine.x2).toNumber() newPStart.x = roofLine.x1 //Big(newPStart.x).minus(eLineX).abs().toNumber() newPEnd.x = aStartX // let idx = sortRoofLines.length < index + 1 ? 0 : index @@ -1303,7 +1304,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => { const newPointY = Big(roofLine.y2).minus(moveDist).toNumber() const pDist = Big(wallLine.y2).minus(roofLine.y2).abs().toNumber() - const pLineX = Big(roofLine.x1).minus(0).abs().toNumber() + const pLineX = Big(roofLine.x1).minus(0).toNumber() // let idx = 0 > index - 1 ? sortRoofLines.length : index // const pLineY = sortRoofLines[idx - 1].y1 @@ -1330,7 +1331,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => { const newPointY = Big(roofLine.y1).minus(moveDist).toNumber() const pDist = Big(wallLine.y1).minus(roofLine.y1).abs().toNumber() - const pLineX = Big(roofLine.x2).minus(0).abs().toNumber() + const pLineX = Big(roofLine.x2).minus(0).toNumber() // let idx = sortRoofLines.length < index + 1 ? 0 : index // const pLineY = sortRoofLines[idx + 1].y2 @@ -1353,8 +1354,8 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => { console.log('bottom_out isStartEnd:::::::', isStartEnd) if (isStartEnd.start) { const moveDist = Big(wallLine.y1).minus(wallBaseLine.y1).abs().toNumber() - const aStartX = Big(roofLine.x1).minus(moveDist).abs().toNumber() - const bStartX = Big(wallLine.x1).minus(moveDist).abs().toNumber() + const aStartX = Big(roofLine.x1).minus(moveDist).toNumber() + const bStartX = Big(wallLine.x1).minus(moveDist).toNumber() const inLine = findLineContainingPoint(innerLines, { x: aStartX, y: roofLine.y1 }) console.log('startLines:::::::', inLine) const eLineX = Big(bStartX).minus(wallLine.x1).abs().toNumber()