From 7ac16fbf5dee5996b412bda5300211f82c374dc9 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Fri, 17 Jan 2025 13:43:24 +0900 Subject: [PATCH] =?UTF-8?q?directionText=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/usePolygon.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/hooks/usePolygon.js b/src/hooks/usePolygon.js index 4a8ecfdc..9c690a6b 100644 --- a/src/hooks/usePolygon.js +++ b/src/hooks/usePolygon.js @@ -427,6 +427,12 @@ export const usePolygon = () => { text = '西西南' } + const sameDirectionCnt = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.ROOF && obj.directionText === text) + + text = text + (sameDirectionCnt.length + 1) + + polygon.set('directionText', text) + const textObj = new fabric.Text(`${text} (${currentAngleType === ANGLE_TYPE.SLOPE ? arrow.pitch : getDegreeByChon(arrow.pitch)}${pitchText})`, { fontFamily: flowFontOptions.fontFamily.value, fontWeight: flowFontOptions.fontWeight.value.toLowerCase().includes('bold') ? 'bold' : 'normal',