Merge pull request 'dev' (#469) from dev into dev-deploy
Reviewed-on: #469
This commit is contained in:
commit
f893eece09
@ -180,18 +180,9 @@ 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])
|
||||||
|
|
||||||
@ -247,7 +238,9 @@ export function useMovementSetting(id) {
|
|||||||
|
|
||||||
const mouseMoveEvent = (e) => {
|
const mouseMoveEvent = (e) => {
|
||||||
//console.log('mouseMoveEvent:::::',e)
|
//console.log('mouseMoveEvent:::::',e)
|
||||||
const target = canvas.getActiveObject()
|
// 기존에는 activeObject를 사용했으나, 이 기능에서는 선택된 라인을 비선택(selectable:false) 상태로 두므로
|
||||||
|
// 항상 selectedObject.current를 기준으로 계산한다.
|
||||||
|
const target = selectedObject.current
|
||||||
if (!target) return
|
if (!target) return
|
||||||
|
|
||||||
// 디버깅 로그 추가
|
// 디버깅 로그 추가
|
||||||
@ -285,11 +278,23 @@ 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) {
|
||||||
@ -618,11 +623,13 @@ export function useMovementSetting(id) {
|
|||||||
value = value.neg()
|
value = value.neg()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//console.log("error::", UP_DOWN_REF)
|
console.log("error::", UP_DOWN_REF.POINTER_INPUT_REF.current.value)
|
||||||
value =
|
value = Big(
|
||||||
UP_DOWN_REF.FILLED_INPUT_REF.current.value !== ''
|
(UP_DOWN_REF?.FILLED_INPUT_REF?.current?.value?.trim() ||
|
||||||
? Big(UP_DOWN_REF.FILLED_INPUT_REF.current.value)
|
UP_DOWN_REF?.POINTER_INPUT_REF?.current?.value?.trim() ||
|
||||||
: Big(UP_DOWN_REF.POINTER_INPUT_REF.current.value)
|
'0'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
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)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user