조건 체크 수정

This commit is contained in:
hyojun.choi 2025-02-12 11:24:43 +09:00
parent 0c8521c7ea
commit d9fb243d14

View File

@ -2443,25 +2443,25 @@ export const useTrestle = () => {
(centerPoint) => Math.abs(centerPoint.x - halfTopRightPoint.x) < maxX && Math.abs(centerPoint.y - halfTopRightPoint.y) < maxY, (centerPoint) => Math.abs(centerPoint.x - halfTopRightPoint.x) < maxX && Math.abs(centerPoint.y - halfTopRightPoint.y) < maxY,
) )
} }
if (leftModule) { if (!leftModule) {
leftPoint = { x: x - width, y: y } leftPoint = { x: x - width, y: y }
leftModule = centerPoints.find( leftModule = centerPoints.find(
(centerPoint) => Math.abs(centerPoint.x - leftPoint.x) < maxX && Math.abs(centerPoint.y - leftPoint.y) < maxY, (centerPoint) => Math.abs(centerPoint.x - leftPoint.x) < maxX && Math.abs(centerPoint.y - leftPoint.y) < maxY,
) )
} }
if (rightModule) { if (!rightModule) {
rightPoint = { x: x + width, y: y } rightPoint = { x: x + width, y: y }
rightModule = centerPoints.find( rightModule = centerPoints.find(
(centerPoint) => Math.abs(centerPoint.x - rightPoint.x) < maxX && Math.abs(centerPoint.y - rightPoint.y) < maxY, (centerPoint) => Math.abs(centerPoint.x - rightPoint.x) < maxX && Math.abs(centerPoint.y - rightPoint.y) < maxY,
) )
} }
if (bottomLeftModule) { if (!bottomLeftModule) {
bottomLeftPoint = { x: x - width, y: y + h } bottomLeftPoint = { x: x - width, y: y + h }
bottomLeftModule = centerPoints.find( bottomLeftModule = centerPoints.find(
(centerPoint) => Math.abs(centerPoint.x - bottomLeftPoint.x) < maxX && Math.abs(centerPoint.y - bottomLeftPoint.y) < maxY, (centerPoint) => Math.abs(centerPoint.x - bottomLeftPoint.x) < maxX && Math.abs(centerPoint.y - bottomLeftPoint.y) < maxY,
) )
} }
if (bottomRightModule) { if (!bottomRightModule) {
bottomRightPoint = { x: x + width, y: y + h } bottomRightPoint = { x: x + width, y: y + h }
bottomRightModule = centerPoints.find( bottomRightModule = centerPoints.find(
(centerPoint) => Math.abs(centerPoint.x - bottomRightPoint.x) < maxX && Math.abs(centerPoint.y - bottomRightPoint.y) < maxY, (centerPoint) => Math.abs(centerPoint.x - bottomRightPoint.x) < maxX && Math.abs(centerPoint.y - bottomRightPoint.y) < maxY,
@ -2504,25 +2504,25 @@ export const useTrestle = () => {
(centerPoint) => Math.abs(centerPoint.x - halfTopRightPoint.x) < maxX && Math.abs(centerPoint.y - halfTopRightPoint.y) < maxY, (centerPoint) => Math.abs(centerPoint.x - halfTopRightPoint.x) < maxX && Math.abs(centerPoint.y - halfTopRightPoint.y) < maxY,
) )
} }
if (leftModule) { if (!leftModule) {
leftPoint = { x: x + width, y: y } leftPoint = { x: x + width, y: y }
leftModule = centerPoints.find( leftModule = centerPoints.find(
(centerPoint) => Math.abs(centerPoint.x - leftPoint.x) < maxX && Math.abs(centerPoint.y - leftPoint.y) < maxY, (centerPoint) => Math.abs(centerPoint.x - leftPoint.x) < maxX && Math.abs(centerPoint.y - leftPoint.y) < maxY,
) )
} }
if (rightModule) { if (!rightModule) {
rightPoint = { x: x - width, y: y } rightPoint = { x: x - width, y: y }
rightModule = centerPoints.find( rightModule = centerPoints.find(
(centerPoint) => Math.abs(centerPoint.x - rightPoint.x) < maxX && Math.abs(centerPoint.y - rightPoint.y) < maxY, (centerPoint) => Math.abs(centerPoint.x - rightPoint.x) < maxX && Math.abs(centerPoint.y - rightPoint.y) < maxY,
) )
} }
if (bottomLeftModule) { if (!bottomLeftModule) {
bottomLeftPoint = { x: x + width, y: y - h } bottomLeftPoint = { x: x + width, y: y - h }
bottomLeftModule = centerPoints.find( bottomLeftModule = centerPoints.find(
(centerPoint) => Math.abs(centerPoint.x - bottomLeftPoint.x) < maxX && Math.abs(centerPoint.y - bottomLeftPoint.y) < maxY, (centerPoint) => Math.abs(centerPoint.x - bottomLeftPoint.x) < maxX && Math.abs(centerPoint.y - bottomLeftPoint.y) < maxY,
) )
} }
if (bottomRightModule) { if (!bottomRightModule) {
bottomRightPoint = { x: x - width, y: y - h } bottomRightPoint = { x: x - width, y: y - h }
bottomRightModule = centerPoints.find( bottomRightModule = centerPoints.find(
(centerPoint) => Math.abs(centerPoint.x - bottomRightPoint.x) < maxX && Math.abs(centerPoint.y - bottomRightPoint.y) < maxY, (centerPoint) => Math.abs(centerPoint.x - bottomRightPoint.x) < maxX && Math.abs(centerPoint.y - bottomRightPoint.y) < maxY,