동,현 연결

This commit is contained in:
ysCha 2025-12-17 15:34:15 +09:00
parent 80e555d653
commit 88136403f7

View File

@ -181,49 +181,7 @@ const movingLineFromSkeleton = (roofId, canvas) => {
const offset = line.attributes.offset const offset = line.attributes.offset
// 새로운 좌표 계산 // 새로운 좌표 계산
let newStartPoint = {...originalStartPoint}; let newStartPoint = {...originalStartPoint};
let newEndPoint = {...originalEndPoint}; let newEndPoint = {...originalEndPoint}
// 위치와 방향에 따라 좌표 조정
/*
switch (position) {
case 'left':
if (moveDirection === 'up') {
newStartPoint.x = Big(line.startPoint.x).minus(absMove).toNumber();
newEndPoint.x = Big(line.endPoint.x).minus(absMove).toNumber();
} else if (moveDirection === 'down') {
newStartPoint.x = Big(line.startPoint.x).plus(absMove).toNumber();
newEndPoint.x = Big(line.endPoint.x).plus(absMove).toNumber();
}
break;
case 'right':
if (moveDirection === 'up') {
newStartPoint.x = Big(line.startPoint.x).plus(absMove).toNumber();
newEndPoint.x = Big(line.endPoint.x).plus(absMove).toNumber();
} else if (moveDirection === 'down') {
newStartPoint.x = Big(line.startPoint.x).minus(absMove).toNumber();
newEndPoint.x = Big(line.endPoint.x).minus(absMove).toNumber();
}
break;
case 'top':
if (moveDirection === 'up') {
newStartPoint.y = Big(line.startPoint.y).minus(absMove).toNumber();
newEndPoint.y = Big(line.endPoint.y).minus(absMove).toNumber();
} else if (moveDirection === 'down') {
newStartPoint.y = Big(line.startPoint.y).plus(absMove).toNumber();
newEndPoint.y = Big(line.endPoint.y).plus(absMove).toNumber();
}
break;
case 'bottom':
if (moveDirection === 'up') {
newStartPoint.y = Big(line.startPoint.y).plus(absMove).toNumber();
newEndPoint.y = Big(line.endPoint.y).plus(absMove).toNumber();
} else if (moveDirection === 'down') {
newStartPoint.y = Big(line.startPoint.y).minus(absMove).toNumber();
newEndPoint.y = Big(line.endPoint.y).minus(absMove).toNumber();
}
break;
}
*/
// 원본 라인 업데이트 // 원본 라인 업데이트
// newPoints 배열에서 일치하는 포인트들을 찾아서 업데이트 // newPoints 배열에서 일치하는 포인트들을 찾아서 업데이트
console.log('absMove::', moveUpDownLength); console.log('absMove::', moveUpDownLength);
@ -650,8 +608,9 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
canvas.renderAll(); canvas.renderAll();
}); });
//if((roof.moveUpDown??0 > 0) ) { if((roof.moveUpDown??0 > 0) || (roof.moveFlowLine??0 > 0) ) {
const getMoveUpDownLine = () => {
// 같은 라인이 없으므로 새 다각형 라인 생성 // 같은 라인이 없으므로 새 다각형 라인 생성
//라인 편집 //라인 편집
// let i = 0 // let i = 0
@ -854,17 +813,39 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
strokeWidth: 4, strokeWidth: 4,
name : 'eaveHelpLine', name : 'eaveHelpLine',
lineName : 'eaveHelpLine', lineName : 'eaveHelpLine',
selectable : true,
visible : true, visible : true,
roofId : roofId, roofId : roofId,
selectable: true,
hoverCursor: 'pointer',
attributes : { attributes : {
type : 'eaveHelpLine', type : 'eaveHelpLine',
isStart: true, isStart: true,
pitch : wallLine.attributes.pitch, pitch : wallLine.attributes.pitch,
} }
}); });
// Add right-click handler
line.on('mousedown', function(options) {
if (options.e.button === 2) { // Right click
options.e.preventDefault();
options.e.stopPropagation();
// Trigger the context menu
if (canvas) {
canvas.setActiveObject(line);
canvas.fire('mouse:down', {
e: options.e,
target: line,
subTargets: [line]
});
}
}
});
coordinateText(line) coordinateText(line)
canvas.add(line) canvas.add(line)
line.bringToFront()
canvas.renderAll(); canvas.renderAll();
return line return line
} }
@ -1546,10 +1527,12 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
} }
canvas.renderAll() canvas.renderAll()
}); });
// } }
getMoveUpDownLine()
}
if (findPoints.length > 0) { if (findPoints.length > 0) {
// 모든 점에 대해 라인 업데이트를 누적 // 모든 점에 대해 라인 업데이트를 누적