diff --git a/src/hooks/usePolygon.js b/src/hooks/usePolygon.js index 532f2aac..4807ec9b 100644 --- a/src/hooks/usePolygon.js +++ b/src/hooks/usePolygon.js @@ -61,12 +61,18 @@ export const usePolygon = () => { let left, top - if (line.direction === 'left' || line.direction === 'right') { + if (line.direction === 'right') { left = (x1 + x2) / 2 top = (y1 + y2) / 2 + 10 - } else if (line.direction === 'top' || line.direction === 'bottom') { + } else if (line.direction === 'top') { left = (x1 + x2) / 2 + 10 top = (y1 + y2) / 2 + } else if (line.direction === 'left') { + left = (x1 + x2) / 2 + top = (y1 + y2) / 2 - 30 + } else if (line.direction === 'bottom') { + left = (x1 + x2) / 2 - 50 + top = (y1 + y2) / 2 } const minX = line.left