baseLine수정
This commit is contained in:
parent
34a1a6d201
commit
fecc4e999a
@ -263,12 +263,33 @@ export function useMovementSetting(id) {
|
|||||||
const currentY = Big(getIntersectMousePoint(e).y)
|
const currentY = Big(getIntersectMousePoint(e).y)
|
||||||
|
|
||||||
let value = ''
|
let value = ''
|
||||||
if (Math.abs(target.y1 - target.y2) < 0.5) {
|
let direction = ''
|
||||||
|
|
||||||
|
if (Math.abs(target.y1 - target.y2) < 0.5) { // 수평 라인
|
||||||
value = Big(targetTop).minus(currentY).times(10).round(0)
|
value = Big(targetTop).minus(currentY).times(10).round(0)
|
||||||
} else {
|
|
||||||
|
// 방향 감지
|
||||||
|
if (value.toNumber() > 0) {
|
||||||
|
direction = 'up' // 마우스가 라인 위쪽에 있음 (위로 움직임)
|
||||||
|
} else if (value.toNumber() < 0) {
|
||||||
|
direction = 'down' // 마우스가 라인 아래쪽에 있음 (아래로 움직임)
|
||||||
|
}
|
||||||
|
} else { // 수직 라인
|
||||||
value = Big(targetLeft).minus(currentX).times(10).round(0).neg()
|
value = Big(targetLeft).minus(currentX).times(10).round(0).neg()
|
||||||
|
|
||||||
|
// 방향 감지
|
||||||
|
if (value.toNumber() > 0) {
|
||||||
|
direction = 'right' // 마우스가 라인 오른쪽에 있음 (오른쪽으로 움직임)
|
||||||
|
} else if (value.toNumber() < 0) {
|
||||||
|
direction = 'left' // 마우스가 라인 왼쪽에 있음 (왼쪽으로 움직임)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 방향 정보를 사용하여 라디오 버튼 상태 업데이트
|
||||||
|
|
||||||
|
console.log(`방향: ${direction}, 값: ${value.toNumber()}`)
|
||||||
|
|
||||||
|
|
||||||
currentCalculatedValue = value.toNumber()
|
currentCalculatedValue = value.toNumber()
|
||||||
|
|
||||||
if (typeRef.current === TYPE.FLOW_LINE) {
|
if (typeRef.current === TYPE.FLOW_LINE) {
|
||||||
@ -286,6 +307,8 @@ export function useMovementSetting(id) {
|
|||||||
const midY = Big(target.y1).plus(target.y2).div(2)
|
const midY = Big(target.y1).plus(target.y2).div(2)
|
||||||
const wall = canvas.getObjects().find((obj) => obj.id === target.attributes.wallId)
|
const wall = canvas.getObjects().find((obj) => obj.id === target.attributes.wallId)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const result = getSelectLinePosition(wall, target, {
|
const result = getSelectLinePosition(wall, target, {
|
||||||
testDistance: 5, // 테스트 거리
|
testDistance: 5, // 테스트 거리
|
||||||
debug: true // 디버깅 로그 출력
|
debug: true // 디버깅 로그 출력
|
||||||
@ -294,6 +317,7 @@ export function useMovementSetting(id) {
|
|||||||
//console.log("1111linePosition:::::", result.position); // 'top', 'bottom', 'left', 'right'
|
//console.log("1111linePosition:::::", result.position); // 'top', 'bottom', 'left', 'right'
|
||||||
|
|
||||||
let linePosition = result.position;
|
let linePosition = result.position;
|
||||||
|
console.log("1111linePosition:::::", direction, linePosition);
|
||||||
|
|
||||||
if (target.y1 === target.y2) { //수평벽
|
if (target.y1 === target.y2) { //수평벽
|
||||||
|
|
||||||
@ -312,7 +336,9 @@ export function useMovementSetting(id) {
|
|||||||
setRadioStates(value.s !== 1);
|
setRadioStates(value.s !== 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(direction === 'up') {
|
||||||
|
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
checkPoint = { x: midX.toNumber(), y: midY.plus(10).toNumber() }
|
checkPoint = { x: midX.toNumber(), y: midY.plus(10).toNumber() }
|
||||||
if (wall.inPolygon(checkPoint)) { //선택라인이 내부
|
if (wall.inPolygon(checkPoint)) { //선택라인이 내부
|
||||||
@ -376,6 +402,7 @@ export function useMovementSetting(id) {
|
|||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -623,8 +650,8 @@ export function useMovementSetting(id) {
|
|||||||
debug: true // 디버깅 로그 출력
|
debug: true // 디버깅 로그 출력
|
||||||
});
|
});
|
||||||
|
|
||||||
//console.log("2222linePosition:::::", result.position);
|
console.log("2222linePosition:::::", result.position);
|
||||||
|
console.log("222moveDirect:::::", roof.moveDirect);
|
||||||
|
|
||||||
|
|
||||||
// 디버깅용 분류 결과 확인
|
// 디버깅용 분류 결과 확인
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user