From d4a678aae6f4919c13f93356dd7ae922c35f8ade Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Tue, 12 Nov 2024 16:56:04 +0900 Subject: [PATCH] =?UTF-8?q?=ED=8F=B0=ED=8A=B8=EA=B4=80=EB=A0=A8=20?= =?UTF-8?q?=EC=98=B5=EC=85=98=20=EC=88=98=EC=A0=95,=20=EB=AC=B8=EC=9E=90?= =?UTF-8?q?=ED=91=9C=EC=8B=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/option/useFirstOption.js | 2 +- src/hooks/usePolygon.js | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/hooks/option/useFirstOption.js b/src/hooks/option/useFirstOption.js index c296a942..8757040a 100644 --- a/src/hooks/option/useFirstOption.js +++ b/src/hooks/option/useFirstOption.js @@ -40,7 +40,7 @@ export function useFirstOption() { optionName = ['roof', POLYGON_TYPE.ROOF] break case 'wordDisplay': //문자 표시 - optionName = ['6'] + optionName = ['commonText'] break case 'circuitNumDisplay': //회로번호 표시 optionName = ['7'] diff --git a/src/hooks/usePolygon.js b/src/hooks/usePolygon.js index 21c708ee..b3730493 100644 --- a/src/hooks/usePolygon.js +++ b/src/hooks/usePolygon.js @@ -285,12 +285,14 @@ export const usePolygon = () => { const { direction, surfaceCompass, moduleCompass, arrow } = polygon if (moduleCompass === null || moduleCompass === undefined) { const textObj = new fabric.Text(`${currentAngleType === ANGLE_TYPE.SLOPE ? arrow.pitch : getDegreeByChon(arrow.pitch)}${pitchText}`, { + fontFamily: flowFontOptions.fontFamily.value, + fontWeight: flowFontOptions.fontWeight.value.toLowerCase().includes('bold') ? 'bold' : 'normal', + fontStyle: flowFontOptions.fontWeight.value.toLowerCase().includes('italic') ? 'italic' : 'normal', fontSize: flowFontOptions.fontSize.value, fill: flowFontOptions.fontColor.value, - fontFamily: flowFontOptions.fontFamily.value, - fontWeight: flowFontOptions.fontWeight.value, originX: 'center', originY: 'center', + pitch: arrow.pitch, name: 'flowText', selectable: false, left: arrow.stickeyPoint.x, @@ -426,10 +428,12 @@ export const usePolygon = () => { } 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', + fontStyle: flowFontOptions.fontWeight.value.toLowerCase().includes('italic') ? 'italic' : 'normal', fontSize: flowFontOptions.fontSize.value, fill: flowFontOptions.fontColor.value, - fontFamily: flowFontOptions.fontFamily.value, - fontWeight: flowFontOptions.fontWeight.value, + pitch: arrow.pitch, originX: 'center', originY: 'center', name: 'flowText', @@ -641,10 +645,11 @@ export const usePolygon = () => { const textStr = `${txt} (${currentAngleType === ANGLE_TYPE.SLOPE ? arrow.pitch : getDegreeByChon(arrow.pitch)}${pitchText})` const text = new fabric.Text(`${textStr}`, { + fontFamily: flowFontOptions.fontFamily.value, + fontWeight: flowFontOptions.fontWeight.value.toLowerCase().includes('bold') ? 'bold' : 'normal', + fontStyle: flowFontOptions.fontWeight.value.toLowerCase().includes('italic') ? 'italic' : 'normal', fontSize: flowFontOptions.fontSize.value, fill: flowFontOptions.fontColor.value, - fontFamily: flowFontOptions.fontFamily.value, - fontWeight: flowFontOptions.fontWeight.value, pitch: arrow.pitch, originX: 'center', originY: 'center',