벽 라인 wallLine 속성 변경으로 수정

This commit is contained in:
hyojun.choi 2026-01-08 17:03:14 +09:00
parent 10bdc6e8ab
commit fbb1f352e9

View File

@ -323,14 +323,10 @@ export function useRoofAllocationSetting(id) {
} }
const drawOriginRoofLine = () => { const drawOriginRoofLine = () => {
// outerLinePoints 배열을 이용하여 빨간색 Line 객체들 생성 const wallLines = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.WALL)
if (outerLinePoints && outerLinePoints.length > 1) { /** 벽면 삭제 */
// 연속된 점들을 연결하여 라인 생성 wallLines.forEach((wallLine) => {
for (let i = 0; i < outerLinePoints.length - 1; i++) { wallLine.set({
const point1 = outerLinePoints[i]
const point2 = outerLinePoints[i + 1]
const line = new fabric.Line([point1.x, point1.y, point2.x, point2.y], {
stroke: 'black', stroke: 'black',
strokeDashArray: [5, 2], strokeDashArray: [5, 2],
strokeWidth: 1, strokeWidth: 1,
@ -338,28 +334,9 @@ export function useRoofAllocationSetting(id) {
name: 'originRoofOuterLine', name: 'originRoofOuterLine',
visible: outlineDisplay, visible: outlineDisplay,
}) })
canvas.add(line)
}
// 마지막 점과 첫 점을 연결하여 폐곡선 만들기
if (outerLinePoints.length > 2) {
const lastPoint = outerLinePoints[outerLinePoints.length - 1]
const firstPoint = outerLinePoints[0]
const closingLine = new fabric.Line([lastPoint.x, lastPoint.y, firstPoint.x, firstPoint.y], {
stroke: 'red',
strokeWidth: 2,
selectable: false,
name: 'originRoofOuterLine',
}) })
canvas.add(closingLine)
}
canvas.renderAll() canvas.renderAll()
} }
}
/** /**
* 지붕재 오른쪽 마우스 클릭 단일로 지붕재 변경 필요한 경우 * 지붕재 오른쪽 마우스 클릭 단일로 지붕재 변경 필요한 경우