From e7814a784bae357bf9db8f1293992f080c168e2c Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Thu, 4 Jul 2024 16:09:21 +0900 Subject: [PATCH] =?UTF-8?q?length=20=EC=86=8D=EC=84=B1=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/fabric/QLine.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/fabric/QLine.js b/src/components/fabric/QLine.js index 4bce6a55..66735f69 100644 --- a/src/components/fabric/QLine.js +++ b/src/components/fabric/QLine.js @@ -1,7 +1,7 @@ import { fabric } from 'fabric' export default class QLine extends fabric.Line { - #length + length #text #viewLengthText #fontSize @@ -20,7 +20,7 @@ export default class QLine extends fabric.Line { // 선의 길이를 계산하여 length 속성을 초기화합니다. const dx = this.x2 - this.x1 const dy = this.y2 - this.y1 - this.#length = Math.sqrt(dx * dx + dy * dy).toFixed(0) + this.length = Math.sqrt(dx * dx + dy * dy).toFixed(0) this.#viewLengthText = option.viewLengthText ?? true } @@ -46,7 +46,7 @@ export default class QLine extends fabric.Line { const dx = this.x2 - this.x1 const dy = this.y2 - this.y1 const length = Math.sqrt(dx * dx + dy * dy) - this.#length = length.toFixed(0) // 선의 길이를 length 속성에 저장합니다. + this.length = length.toFixed(0) // 선의 길이를 length 속성에 저장합니다. this.#addLengthText() }) @@ -72,7 +72,7 @@ export default class QLine extends fabric.Line { } if (this.#viewLengthText) { - const text = new fabric.Text(this.#length, { + const text = new fabric.Text(this.length, { left: (this.x1 + this.x2) / 2, top: (this.y1 + this.y2) / 2, fontSize: this.#fontSize,