topRightPoint 검색 범위 수정
This commit is contained in:
parent
b4f2272a6b
commit
1fca294089
@ -873,7 +873,7 @@ export const useTrestle = () => {
|
|||||||
}
|
}
|
||||||
case 'east': {
|
case 'east': {
|
||||||
widthArr.forEach((w) => {
|
widthArr.forEach((w) => {
|
||||||
topRightPoint = { x: x + w, y: y + height / 2 }
|
topRightPoint = { x: x - w, y: y - height / 2 }
|
||||||
if (result) return
|
if (result) return
|
||||||
result = centerPoints.find(
|
result = centerPoints.find(
|
||||||
(centerPoint) => Math.abs(centerPoint.x - topRightPoint.x) < maxX && Math.abs(centerPoint.y - topRightPoint.y) < maxY,
|
(centerPoint) => Math.abs(centerPoint.x - topRightPoint.x) < maxX && Math.abs(centerPoint.y - topRightPoint.y) < maxY,
|
||||||
@ -883,7 +883,7 @@ export const useTrestle = () => {
|
|||||||
}
|
}
|
||||||
case 'west': {
|
case 'west': {
|
||||||
widthArr.forEach((w) => {
|
widthArr.forEach((w) => {
|
||||||
topRightPoint = { x: x - w, y: y - height / 2 }
|
topRightPoint = { x: x + w, y: y + height / 2 }
|
||||||
if (result) return
|
if (result) return
|
||||||
result = centerPoints.find(
|
result = centerPoints.find(
|
||||||
(centerPoint) => Math.abs(centerPoint.x - topRightPoint.x) < maxX && Math.abs(centerPoint.y - topRightPoint.y) < maxY,
|
(centerPoint) => Math.abs(centerPoint.x - topRightPoint.x) < maxX && Math.abs(centerPoint.y - topRightPoint.y) < maxY,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user