Compare commits

..

No commits in common. "f893eece0991db8b520272da38d50333ecff2c21" and "b2f3de0a315b688db279a326fb3d764a0db5d1b4" have entirely different histories.

View File

@ -180,9 +180,18 @@ export function useMovementSetting(id) {
name: 'followLine', name: 'followLine',
}) })
canvas.add(followLine) canvas.add(followLine)
followLine.bringToFront()
FOLLOW_LINE_REF.current = followLine 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() canvas.renderAll()
}, [currentObject]) }, [currentObject])
@ -238,9 +247,7 @@ export function useMovementSetting(id) {
const mouseMoveEvent = (e) => { const mouseMoveEvent = (e) => {
//console.log('mouseMoveEvent:::::',e) //console.log('mouseMoveEvent:::::',e)
// 기존에는 activeObject를 사용했으나, 이 기능에서는 선택된 라인을 비선택(selectable:false) 상태로 두므로 const target = canvas.getActiveObject()
// 항상 selectedObject.current를 기준으로 계산한다.
const target = selectedObject.current
if (!target) return 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() currentCalculatedValue = value.toNumber()
if (typeRef.current === TYPE.FLOW_LINE) { if (typeRef.current === TYPE.FLOW_LINE) {
@ -623,13 +618,11 @@ export function useMovementSetting(id) {
value = value.neg() value = value.neg()
} }
} else { } else {
console.log("error::", UP_DOWN_REF.POINTER_INPUT_REF.current.value) //console.log("error::", UP_DOWN_REF)
value = Big( value =
(UP_DOWN_REF?.FILLED_INPUT_REF?.current?.value?.trim() || UP_DOWN_REF.FILLED_INPUT_REF.current.value !== ''
UP_DOWN_REF?.POINTER_INPUT_REF?.current?.value?.trim() || ? Big(UP_DOWN_REF.FILLED_INPUT_REF.current.value)
'0' : Big(UP_DOWN_REF.POINTER_INPUT_REF.current.value)
)
);
const midX = Big(target.x1).plus(target.x2).div(2) const midX = Big(target.x1).plus(target.x2).div(2)
const midY = Big(target.y1).plus(target.y2).div(2) const midY = Big(target.y1).plus(target.y2).div(2)