From c933db43d2c98040a3d244f9d0afcbf668785133 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Wed, 12 Feb 2025 16:51:00 +0900 Subject: [PATCH] =?UTF-8?q?maxY=EA=B0=92=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/module/useTrestle.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/hooks/module/useTrestle.js b/src/hooks/module/useTrestle.js index 0e88d590..3f52f0ca 100644 --- a/src/hooks/module/useTrestle.js +++ b/src/hooks/module/useTrestle.js @@ -807,7 +807,9 @@ export const useTrestle = () => { heightArr.forEach((h) => { topLeftPoint = { x: x - width / 2, y: y - h } if (result) return - result = centerPoints.find((centerPoint) => Math.abs(centerPoint.x - topLeftPoint.x) < maxX && Math.abs(centerPoint.y - topLeftPoint.y)) + result = centerPoints.find( + (centerPoint) => Math.abs(centerPoint.x - topLeftPoint.x) < maxX && Math.abs(centerPoint.y - topLeftPoint.y) < maxY, + ) }) break @@ -818,7 +820,9 @@ export const useTrestle = () => { heightArr.forEach((h) => { topLeftPoint = { x: x + width / 2, y: y + h } if (result) return - result = centerPoints.find((centerPoint) => Math.abs(centerPoint.x - topLeftPoint.x) < maxX && Math.abs(centerPoint.y - topLeftPoint.y)) + result = centerPoints.find( + (centerPoint) => Math.abs(centerPoint.x - topLeftPoint.x) < maxX && Math.abs(centerPoint.y - topLeftPoint.y) < maxY, + ) }) break } @@ -864,7 +868,9 @@ export const useTrestle = () => { heightArr.forEach((h) => { topRightPoint = { x: x + width / 2, y: y - h } if (result) return - result = centerPoints.find((centerPoint) => Math.abs(centerPoint.x - topRightPoint.x) < maxX && Math.abs(centerPoint.y - topRightPoint.y)) + result = centerPoints.find( + (centerPoint) => Math.abs(centerPoint.x - topRightPoint.x) < maxX && Math.abs(centerPoint.y - topRightPoint.y) < maxY, + ) }) break @@ -873,7 +879,9 @@ export const useTrestle = () => { heightArr.forEach((h) => { topRightPoint = { x: x - width / 2, y: y + h } if (result) return - result = centerPoints.find((centerPoint) => Math.abs(centerPoint.x - topRightPoint.x) < maxX && Math.abs(centerPoint.y - topRightPoint.y)) + result = centerPoints.find( + (centerPoint) => Math.abs(centerPoint.x - topRightPoint.x) < maxX && Math.abs(centerPoint.y - topRightPoint.y) < maxY, + ) }) break }