From dc857b28facaa87a8b45c467e0926013139fc94d Mon Sep 17 00:00:00 2001 From: ysCha Date: Wed, 20 May 2026 08:46:43 +0900 Subject: [PATCH] =?UTF-8?q?[2173]=20junction-extended=20=ED=8C=A8=ED=84=B4?= =?UTF-8?q?=20outer=20hip=20=EC=A0=9C=EA=B1=B0=20+=20strokeWidth=20SK?= =?UTF-8?q?=EC=99=80=20=ED=86=B5=EC=9D=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [작업내용] : - 대전제 반영: 케라바 ridge 가 생기는 분기에서 c1·c2 에 붙은 outer hip 2개 제거 · inner hip(junction 너머) 보존 · __removedHipsSnapshot 첨부 → revert 시 hip 2개 자동 복원 - revert 분기에서 hip 스냅샷 + ridge 스냅샷 둘 다 순회 복원하도록 대칭 보강 - 케라바 패턴 생성 라인 strokeWidth 2 → 4 (SK 라인과 동일, 6개소) --- src/hooks/roofcover/useEavesGableEdit.js | 41 ++++++++++++++++++------ 1 file changed, 32 insertions(+), 9 deletions(-) diff --git a/src/hooks/roofcover/useEavesGableEdit.js b/src/hooks/roofcover/useEavesGableEdit.js index 14fb825d..5304ad17 100644 --- a/src/hooks/roofcover/useEavesGableEdit.js +++ b/src/hooks/roofcover/useEavesGableEdit.js @@ -637,7 +637,7 @@ export function useEavesGableEdit(id) { parentId: roof.id, fontSize: roof.fontSize, stroke: '#1083E3', - strokeWidth: 2, + strokeWidth: 4, name: LINE_TYPE.SUBLINE.HIP, textMode: roof.textMode, attributes: { roofId: roof.id, planeSize: sz, actualSize: sz, ...snap.attributes }, @@ -653,7 +653,7 @@ export function useEavesGableEdit(id) { parentId: roof.id, fontSize: roof.fontSize, stroke: '#1083E3', - strokeWidth: 2, + strokeWidth: 4, name: LINE_TYPE.SUBLINE.HIP, textMode: roof.textMode, attributes: { roofId: roof.id, planeSize: sz, actualSize: sz }, @@ -667,7 +667,7 @@ export function useEavesGableEdit(id) { hip.attributes = { ...hip.attributes, ...snap.attributes, planeSize: ns, actualSize: ns } } - // junctionExtended: 추가만 했으므로 추가된 ext hip 2개 + ridge 1개만 제거 + 제거됐던 RG-1 복원 + // junctionExtended: ext hip 2개 + ridge 1개 제거 + 제거됐던 RG-1 + outer/inner hip 4개 복원 if (ridgeAtMid.ridge.__patternKind === 'junctionExtended') { const extHips = Array.isArray(ridgeAtMid.ridge.__patternExtHips) ? ridgeAtMid.ridge.__patternExtHips : [] extHips.forEach((h) => { @@ -675,10 +675,11 @@ export function useEavesGableEdit(id) { removeLine(h) roof.innerLines = roof.innerLines.filter((il) => il !== h) }) - const removedSnaps = Array.isArray(ridgeAtMid.ridge.__removedRidgesSnapshot) ? ridgeAtMid.ridge.__removedRidgesSnapshot : [] + const removedRidgeSnaps = Array.isArray(ridgeAtMid.ridge.__removedRidgesSnapshot) ? ridgeAtMid.ridge.__removedRidgesSnapshot : [] + const removedHipSnaps = Array.isArray(ridgeAtMid.ridge.__removedHipsSnapshot) ? ridgeAtMid.ridge.__removedHipsSnapshot : [] removeLine(ridgeAtMid.ridge) roof.innerLines = roof.innerLines.filter((il) => il !== ridgeAtMid.ridge) - removedSnaps.forEach((snap) => { + removedRidgeSnaps.forEach((snap) => { if (!snap) return const pts = [snap.x1, snap.y1, snap.x2, snap.y2] const sz = calcLinePlaneSize({ x1: pts[0], y1: pts[1], x2: pts[2], y2: pts[3] }) @@ -686,7 +687,7 @@ export function useEavesGableEdit(id) { parentId: roof.id, fontSize: roof.fontSize, stroke: '#1083E3', - strokeWidth: 2, + strokeWidth: 4, name: LINE_TYPE.SUBLINE.RIDGE, textMode: roof.textMode, attributes: { roofId: roof.id, planeSize: sz, actualSize: sz, ...snap.attributes }, @@ -696,6 +697,13 @@ export function useEavesGableEdit(id) { restored.bringToFront() roof.innerLines.push(restored) }) + removedHipSnaps.forEach((snap) => { + if (!snap) return + const hip = buildHipFromSnapshot(snap) + canvas.add(hip) + hip.bringToFront() + roof.innerLines.push(hip) + }) removeKerabHalfLabels(target.id) hideOriginalLengthText(target.id, false) canvas.renderAll() @@ -819,7 +827,7 @@ export function useEavesGableEdit(id) { parentId: roof.id, fontSize: roof.fontSize, stroke: '#1083E3', - strokeWidth: 2, + strokeWidth: 4, name: LINE_TYPE.SUBLINE.RIDGE, textMode: roof.textMode, attributes: { roofId: roof.id, planeSize: sz, actualSize: sz }, @@ -862,7 +870,7 @@ export function useEavesGableEdit(id) { parentId: roof.id, fontSize: roof.fontSize, stroke: '#1083E3', - strokeWidth: 2, + strokeWidth: 4, name: LINE_TYPE.SUBLINE.RIDGE, textMode: roof.textMode, attributes: { roofId: roof.id, planeSize: ridgeSz, actualSize: ridgeSz }, @@ -878,7 +886,7 @@ export function useEavesGableEdit(id) { parentId: roof.id, fontSize: roof.fontSize, stroke: '#1083E3', - strokeWidth: 2, + strokeWidth: 4, name: LINE_TYPE.SUBLINE.HIP, textMode: roof.textMode, attributes: { roofId: roof.id, planeSize: sz, actualSize: sz }, @@ -916,6 +924,21 @@ export function useEavesGableEdit(id) { roof.innerLines = roof.innerLines.filter((il) => !ridgesToRemove.includes(il)) } + // [2240 KERAB-HIP-REMOVE 2026-05-19] 대전제: 케라바 외곽선 양 끝점(c1·c2) 에 붙은 hip 만 제거. + // outer1 (c1↔junction1), outer2 (c2↔junction2) — 사용자 선택 처마 양 끝점에서 만나는 hip + // inner (junction 너머) 는 보존. orphan extension 동반 정리, 스냅샷 첨부. + const hipsToRemove = [jp.outer1, jp.outer2] + ridge.__removedHipsSnapshot = hipsToRemove.map(snapshotHip) + for (const hip of hipsToRemove) { + removeOrphanExtensionsForHip(hip) + removeLine(hip) + } + roof.innerLines = roof.innerLines.filter((il) => !hipsToRemove.includes(il)) + logger.log('[KERAB-HIP-REMOVE] outer only', { + outer1: `(${Math.round(jp.outer1.x1)},${Math.round(jp.outer1.y1)})→(${Math.round(jp.outer1.x2)},${Math.round(jp.outer1.y2)})`, + outer2: `(${Math.round(jp.outer2.x1)},${Math.round(jp.outer2.y1)})→(${Math.round(jp.outer2.x2)},${Math.round(jp.outer2.y2)})`, + }) + canvas.add(ext1) canvas.add(ext2) canvas.add(ridge)