maxY값 추가

This commit is contained in:
hyojun.choi 2025-02-12 16:51:00 +09:00
parent 7e376dd7d1
commit c933db43d2

View File

@ -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
}