#1749 모듈 배치 후 회로 설정 오류 수정
This commit is contained in:
parent
ea2c900c83
commit
a11010c00a
@ -149,9 +149,9 @@ export default function CircuitTrestleSetting({ id }) {
|
|||||||
return {
|
return {
|
||||||
x,
|
x,
|
||||||
y,
|
y,
|
||||||
width: Math.floor(width),
|
width: Math.round(width),
|
||||||
height: Math.floor(height),
|
height: Math.round(height),
|
||||||
area: Math.floor(width) * Math.floor(height),
|
area: Math.round(width) * Math.round(height),
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -227,7 +227,7 @@ export default function CircuitTrestleSetting({ id }) {
|
|||||||
// 인접 모듈 여부 확인
|
// 인접 모듈 여부 확인
|
||||||
const isAdjacent = (current, target) => {
|
const isAdjacent = (current, target) => {
|
||||||
const gap = getGap(current, target)
|
const gap = getGap(current, target)
|
||||||
return gap >= 0 && gap <= primaryInterval + 1
|
return gap >= 0 && gap <= primaryInterval + 2
|
||||||
}
|
}
|
||||||
|
|
||||||
// 정렬된 모듈 순회
|
// 정렬된 모듈 순회
|
||||||
@ -238,7 +238,7 @@ export default function CircuitTrestleSetting({ id }) {
|
|||||||
const directTargets = findTargetModules(current, secondaryInterval)
|
const directTargets = findTargetModules(current, secondaryInterval)
|
||||||
const closestTarget = getClosestTarget(directTargets)
|
const closestTarget = getClosestTarget(directTargets)
|
||||||
|
|
||||||
if (closestTarget && isAdjacent(current, closestTarget) && closestTarget.area > current.area) {
|
if (closestTarget && isAdjacent(current, closestTarget) && closestTarget.area - current.area > 1) {
|
||||||
return false // 검증 실패
|
return false // 검증 실패
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -264,7 +264,7 @@ export default function CircuitTrestleSetting({ id }) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const closestHalf = getClosestTarget(findHalfTarget)
|
const closestHalf = getClosestTarget(findHalfTarget)
|
||||||
if (closestHalf && isAdjacent(current, closestHalf) && closestHalf.area > current.area) {
|
if (closestHalf && isAdjacent(current, closestHalf) && closestHalf.area - current.area > 1) {
|
||||||
return false // 검증 실패
|
return false // 검증 실패
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user