From 7132b4b90e0f5b2900c253aabef4af2e11e79b54 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Thu, 6 Feb 2025 14:00:24 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B8=B8=EC=9D=B4=20text=20=EC=9C=84=EC=B9=98?= =?UTF-8?q?=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/usePolygon.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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