From 9369c1c952a0001033861bfa5470c312fb4e0a02 Mon Sep 17 00:00:00 2001 From: Jaeyoung Lee Date: Fri, 9 Jan 2026 17:15:18 +0900 Subject: [PATCH] =?UTF-8?q?qline=20=EC=8B=A4=EC=B9=98=EC=88=98=20=ED=91=9C?= =?UTF-8?q?=EC=8B=9C=20=EB=B6=80=EB=B6=84=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/fabric/QLine.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/fabric/QLine.js b/src/components/fabric/QLine.js index 02448cd7..4608bd58 100644 --- a/src/components/fabric/QLine.js +++ b/src/components/fabric/QLine.js @@ -84,9 +84,12 @@ export const QLine = fabric.util.createClass(fabric.Line, { addLengthText() { const thisText = this.canvas.getObjects().find((obj) => obj.name === 'lengthText' && obj.parentId === this.id) - if (this.textMode === 'none') { - if (thisText) { - this.canvas.remove(thisText) + if (thisText) { + if (this.attributes?.actualSize) { + thisText.set({ actualSize: this.attributes.actualSize }) + } + if (this.attributes?.planeSize) { + thisText.set({ planeSize: this.attributes.planeSize }) } } else { this.setLength() @@ -97,11 +100,6 @@ export const QLine = fabric.util.createClass(fabric.Line, { const x2 = this.left + this.width * scaleX const y2 = this.top + this.height * scaleY - if (thisText) { - thisText.set({ text: this.getLength().toString(), left: (x1 + x2) / 2, top: (y1 + y2) / 2 }) - this.text = thisText - return - } let left, top if (this.direction === 'left' || this.direction === 'right') { left = (x1 + x2) / 2 @@ -118,6 +116,8 @@ export const QLine = fabric.util.createClass(fabric.Line, { const degree = (Math.atan2(y2 - y1, x2 - x1) * 180) / Math.PI const text = new fabric.Textbox(this.getLength().toString(), { + actualSize: this.attributes?.actualSize, + planeSize: this.attributes?.planeSize, left: left, top: top, fontSize: this.fontSize,