From 566de9b2901d104457105cc3e9933fc0cb897efe Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Wed, 4 Sep 2024 15:21:16 +0900 Subject: [PATCH] =?UTF-8?q?QPolygon=20setViewLengthText=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/fabric/QPolygon.js | 9 ++++++--- src/hooks/useMode.js | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/components/fabric/QPolygon.js b/src/components/fabric/QPolygon.js index bb35d4a8..a3329ac5 100644 --- a/src/components/fabric/QPolygon.js +++ b/src/components/fabric/QPolygon.js @@ -693,9 +693,12 @@ export const QPolygon = fabric.util.createClass(fabric.Polygon, { this.wall = wall }, setViewLengthText(isView) { - this.texts.forEach((text) => { - text.set({ visible: isView }) - }) + this.canvas + ?.getObjects() + .filter((obj) => obj.name === 'lengthText' && obj.parent === this) + .forEach((text) => { + text.set({ visible: isView }) + }) }, divideLine() { splitPolygonWithLines(this) diff --git a/src/hooks/useMode.js b/src/hooks/useMode.js index 4b7d9eb5..d4c5ece0 100644 --- a/src/hooks/useMode.js +++ b/src/hooks/useMode.js @@ -4605,6 +4605,7 @@ export function useMode() { }) canvas?.add(trestlePoly) + trestlePoly.setViewLengthText(false) }) removeHelpPointAndHelpLine() }