fix: offset 0인 변에서 색칠된 외벽선이 보조선 선택을 가로채던 문제 수정

[작업내용] :
- 지붕형상 저장 시 외벽선을 bringToFront(맨 앞) 대신 WALL/ROOF 폴리곤 바로 위 인덱스에 삽입
- offset 0이면 보조선이 외벽선과 같은 좌표에 그려지는데, 외벽선이 맨 위에 있으면
  클릭을 가로채(selectable:false라도 evented는 유지됨) 보조선 선택이 불가능했음
- z-order를 폴리곤 < 외벽선 < 보조선·텍스트로 유지해 색 표시와 보조선 클릭을 양립

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Jaeyoung Lee 2026-06-11 18:09:31 +09:00
parent 7900b2e67b
commit 18abbeb902
2 changed files with 14 additions and 2 deletions

View File

@ -263,7 +263,13 @@ export function useRoofShapePassivitySetting(id) {
addPitchTextsByOuterLines() addPitchTextsByOuterLines()
const roof = drawRoofPolygon(wall) const roof = drawRoofPolygon(wall)
addLengthText(roof) addLengthText(roof)
lines.forEach((line) => line.bringToFront())
// 외벽선은 WALL/ROOF 폴리곤 바로 위에 배치 — 맨 앞(bringToFront)으로 올리면
// offset 0인 변에서 같은 좌표에 그려진 보조선의 클릭을 가로채 선택을 막는다
const polygonTopIdx = canvas
.getObjects()
.reduce((top, obj, idx) => (obj.name === POLYGON_TYPE.WALL || obj.name === POLYGON_TYPE.ROOF ? idx : top), -1)
lines.forEach((line) => canvas.moveTo(line, polygonTopIdx))
canvas.renderAll() canvas.renderAll()
} }

View File

@ -155,9 +155,15 @@ export function useRoofShapeSetting(id) {
}) })
addPitchText(line) addPitchText(line)
line.bringToFront()
} }
}) })
// 외벽선은 WALL/ROOF 폴리곤 바로 위에 배치 — 맨 앞(bringToFront)으로 올리면
// offset 0인 변에서 같은 좌표에 그려진 보조선의 클릭을 가로채 선택을 막는다
const polygonTopIdx = canvas
.getObjects()
.reduce((top, obj, idx) => (obj.name === POLYGON_TYPE.WALL || obj.name === POLYGON_TYPE.ROOF ? idx : top), -1)
outerLines.forEach((line) => canvas.moveTo(line, polygonTopIdx))
canvas.renderAll() canvas.renderAll()
} }
}, []) }, [])