지붕할당 후 흐름방향 표시 위치 수정 요청
This commit is contained in:
parent
b10c91909a
commit
d4241c3c16
@ -192,6 +192,7 @@ export const usePolygon = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let centerPoint = { x: polygon.left, y: polygon.top }
|
let centerPoint = { x: polygon.left, y: polygon.top }
|
||||||
|
const { width, height } = polygon
|
||||||
let stickeyPoint
|
let stickeyPoint
|
||||||
|
|
||||||
const polygonMaxX = Math.max(...polygon.getCurrentPoints().map((point) => point.x))
|
const polygonMaxX = Math.max(...polygon.getCurrentPoints().map((point) => point.x))
|
||||||
@ -202,58 +203,58 @@ export const usePolygon = () => {
|
|||||||
switch (direction) {
|
switch (direction) {
|
||||||
case 'north':
|
case 'north':
|
||||||
points = [
|
points = [
|
||||||
{ x: centerPoint.x, y: polygonMinY - 50 },
|
{ x: centerPoint.x - width / 2, y: polygonMinY - 50 },
|
||||||
{ x: centerPoint.x + 20, y: polygonMinY - 50 },
|
{ x: centerPoint.x + 20 - width / 2, y: polygonMinY - 50 },
|
||||||
{ x: centerPoint.x + 20, y: polygonMinY - 80 },
|
{ x: centerPoint.x + 20 - width / 2, y: polygonMinY - 80 },
|
||||||
{ x: centerPoint.x + 50, y: polygonMinY - 80 },
|
{ x: centerPoint.x + 50 - width / 2, y: polygonMinY - 80 },
|
||||||
{ x: centerPoint.x, y: polygonMinY - 110 },
|
{ x: centerPoint.x - width / 2, y: polygonMinY - 110 },
|
||||||
{ x: centerPoint.x - 50, y: polygonMinY - 80 },
|
{ x: centerPoint.x - 50 - width / 2, y: polygonMinY - 80 },
|
||||||
{ x: centerPoint.x - 20, y: polygonMinY - 80 },
|
{ x: centerPoint.x - 20 - width / 2, y: polygonMinY - 80 },
|
||||||
{ x: centerPoint.x - 20, y: polygonMinY - 50 },
|
{ x: centerPoint.x - 20 - width / 2, y: polygonMinY - 50 },
|
||||||
]
|
]
|
||||||
|
|
||||||
stickeyPoint = { x: centerPoint.x, y: polygonMinY - 110 }
|
stickeyPoint = { x: centerPoint.x - width / 2, y: polygonMinY - 110 }
|
||||||
break
|
break
|
||||||
case 'south':
|
case 'south':
|
||||||
points = [
|
points = [
|
||||||
{ x: centerPoint.x, y: polygonMaxY + 50 },
|
{ x: centerPoint.x + width / 2, y: polygonMaxY + 50 },
|
||||||
{ x: centerPoint.x + 20, y: polygonMaxY + 50 },
|
{ x: centerPoint.x + 20 + width / 2, y: polygonMaxY + 50 },
|
||||||
{ x: centerPoint.x + 20, y: polygonMaxY + 80 },
|
{ x: centerPoint.x + 20 + width / 2, y: polygonMaxY + 80 },
|
||||||
{ x: centerPoint.x + 50, y: polygonMaxY + 80 },
|
{ x: centerPoint.x + 50 + width / 2, y: polygonMaxY + 80 },
|
||||||
{ x: centerPoint.x, y: polygonMaxY + 110 },
|
{ x: centerPoint.x + width / 2, y: polygonMaxY + 110 },
|
||||||
{ x: centerPoint.x - 50, y: polygonMaxY + 80 },
|
{ x: centerPoint.x - 50 + width / 2, y: polygonMaxY + 80 },
|
||||||
{ x: centerPoint.x - 20, y: polygonMaxY + 80 },
|
{ x: centerPoint.x - 20 + width / 2, y: polygonMaxY + 80 },
|
||||||
{ x: centerPoint.x - 20, y: polygonMaxY + 50 },
|
{ x: centerPoint.x - 20 + width / 2, y: polygonMaxY + 50 },
|
||||||
]
|
]
|
||||||
stickeyPoint = { x: centerPoint.x, y: polygonMaxY + 110 }
|
stickeyPoint = { x: centerPoint.x + width / 2, y: polygonMaxY + 110 }
|
||||||
break
|
break
|
||||||
case 'west':
|
case 'west':
|
||||||
points = [
|
points = [
|
||||||
{ x: polygonMinX - 50, y: centerPoint.y },
|
{ x: polygonMinX - 50, y: centerPoint.y - height / 2 },
|
||||||
{ x: polygonMinX - 50, y: centerPoint.y + 20 },
|
{ x: polygonMinX - 50, y: centerPoint.y + 20 - height / 2 },
|
||||||
{ x: polygonMinX - 80, y: centerPoint.y + 20 },
|
{ x: polygonMinX - 80, y: centerPoint.y + 20 - height / 2 },
|
||||||
{ x: polygonMinX - 80, y: centerPoint.y + 50 },
|
{ x: polygonMinX - 80, y: centerPoint.y + 50 - height / 2 },
|
||||||
{ x: polygonMinX - 110, y: centerPoint.y },
|
{ x: polygonMinX - 110, y: centerPoint.y - height / 2 },
|
||||||
{ x: polygonMinX - 80, y: centerPoint.y - 50 },
|
{ x: polygonMinX - 80, y: centerPoint.y - 50 - height / 2 },
|
||||||
{ x: polygonMinX - 80, y: centerPoint.y - 20 },
|
{ x: polygonMinX - 80, y: centerPoint.y - 20 - height / 2 },
|
||||||
{ x: polygonMinX - 50, y: centerPoint.y - 20 },
|
{ x: polygonMinX - 50, y: centerPoint.y - 20 - height / 2 },
|
||||||
]
|
]
|
||||||
|
|
||||||
stickeyPoint = { x: polygonMinX - 110, y: centerPoint.y }
|
stickeyPoint = { x: polygonMinX - 110, y: centerPoint.y - height / 2 }
|
||||||
break
|
break
|
||||||
case 'east':
|
case 'east':
|
||||||
points = [
|
points = [
|
||||||
{ x: polygonMaxX + 50, y: centerPoint.y },
|
{ x: polygonMaxX + 50, y: centerPoint.y + height / 2 },
|
||||||
{ x: polygonMaxX + 50, y: centerPoint.y + 20 },
|
{ x: polygonMaxX + 50, y: centerPoint.y + 20 + height / 2 },
|
||||||
{ x: polygonMaxX + 80, y: centerPoint.y + 20 },
|
{ x: polygonMaxX + 80, y: centerPoint.y + 20 + height / 2 },
|
||||||
{ x: polygonMaxX + 80, y: centerPoint.y + 50 },
|
{ x: polygonMaxX + 80, y: centerPoint.y + 50 + height / 2 },
|
||||||
{ x: polygonMaxX + 110, y: centerPoint.y },
|
{ x: polygonMaxX + 110, y: centerPoint.y + height / 2 },
|
||||||
{ x: polygonMaxX + 80, y: centerPoint.y - 50 },
|
{ x: polygonMaxX + 80, y: centerPoint.y - 50 + height / 2 },
|
||||||
{ x: polygonMaxX + 80, y: centerPoint.y - 20 },
|
{ x: polygonMaxX + 80, y: centerPoint.y - 20 + height / 2 },
|
||||||
{ x: polygonMaxX + 50, y: centerPoint.y - 20 },
|
{ x: polygonMaxX + 50, y: centerPoint.y - 20 + height / 2 },
|
||||||
]
|
]
|
||||||
|
|
||||||
stickeyPoint = { x: polygonMaxX + 110, y: centerPoint.y }
|
stickeyPoint = { x: polygonMaxX + 110, y: centerPoint.y + height / 2 }
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user