조건 체크 수정
This commit is contained in:
parent
0c8521c7ea
commit
d9fb243d14
@ -2443,25 +2443,25 @@ export const useTrestle = () => {
|
||||
(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 }
|
||||
leftModule = centerPoints.find(
|
||||
(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 }
|
||||
rightModule = centerPoints.find(
|
||||
(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 }
|
||||
bottomLeftModule = centerPoints.find(
|
||||
(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 }
|
||||
bottomRightModule = centerPoints.find(
|
||||
(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,
|
||||
)
|
||||
}
|
||||
if (leftModule) {
|
||||
if (!leftModule) {
|
||||
leftPoint = { x: x + width, y: y }
|
||||
leftModule = centerPoints.find(
|
||||
(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 }
|
||||
rightModule = centerPoints.find(
|
||||
(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 }
|
||||
bottomLeftModule = centerPoints.find(
|
||||
(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 }
|
||||
bottomRightModule = centerPoints.find(
|
||||
(centerPoint) => Math.abs(centerPoint.x - bottomRightPoint.x) < maxX && Math.abs(centerPoint.y - bottomRightPoint.y) < maxY,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user