Compare commits

..

No commits in common. "39bf5f5cccb803506e689dbaabe0d716dedfe8a0" and "25c7037e868fa0bf67c9e6c5c4d2f25f4ad34627" have entirely different histories.

View File

@ -180,9 +180,18 @@ export function useMovementSetting(id) {
name: 'followLine',
})
canvas.add(followLine)
followLine.bringToFront()
FOLLOW_LINE_REF.current = followLine
canvas.on('mouse:move', (event) => {
const mousePos = getIntersectMousePoint(event)
if (followLine.x1 === followLine.x2) {
followLine.left = mousePos.x - 2
} else {
followLine.top = mousePos.y - 2
}
canvas.renderAll()
})
canvas.renderAll()
}, [currentObject])
@ -238,9 +247,7 @@ export function useMovementSetting(id) {
const mouseMoveEvent = (e) => {
//console.log('mouseMoveEvent:::::',e)
// 기존에는 activeObject를 사용했으나, 이 기능에서는 선택된 라인을 비선택(selectable:false) 상태로 두므로
// 항상 selectedObject.current를 기준으로 계산한다.
const target = selectedObject.current
const target = canvas.getActiveObject()
if (!target) return
// 디버깅 로그 추가
@ -278,23 +285,11 @@ export function useMovementSetting(id) {
}
}
// followLine도 포인터를 따라가도록 동기화 (하나의 mouse:move 핸들러만 사용)
const followLine = FOLLOW_LINE_REF.current
if (followLine) {
if (followLine.x1 === followLine.x2) {
// 수직 라인: x만 이동
followLine.left = currentX.toNumber() - 2
} else {
// 수평 라인: y만 이동
followLine.top = currentY.toNumber() - 2
}
followLine.bringToFront()
followLine.setCoords && followLine.setCoords()
canvas.renderAll()
}
// 방향 정보를 사용하여 라디오 버튼 상태 업데이트
//console.log(`방향: ${direction}, 값: ${value.toNumber()}`)
currentCalculatedValue = value.toNumber()
if (typeRef.current === TYPE.FLOW_LINE) {
@ -623,13 +618,11 @@ export function useMovementSetting(id) {
value = value.neg()
}
} else {
console.log("error::", UP_DOWN_REF.POINTER_INPUT_REF.current.value)
value = Big(
(UP_DOWN_REF?.FILLED_INPUT_REF?.current?.value?.trim() ||
UP_DOWN_REF?.POINTER_INPUT_REF?.current?.value?.trim() ||
'0'
)
);
//console.log("error::", UP_DOWN_REF)
value =
UP_DOWN_REF.FILLED_INPUT_REF.current.value !== ''
? Big(UP_DOWN_REF.FILLED_INPUT_REF.current.value)
: Big(UP_DOWN_REF.POINTER_INPUT_REF.current.value)
const midX = Big(target.x1).plus(target.x2).div(2)
const midY = Big(target.y1).plus(target.y2).div(2)