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() }