diff --git a/src/components/fabric/QLine.js b/src/components/fabric/QLine.js index 66735f69..a5d63c83 100644 --- a/src/components/fabric/QLine.js +++ b/src/components/fabric/QLine.js @@ -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 = Number(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 = Number(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.toString(), { left: (this.x1 + this.x2) / 2, top: (this.y1 + this.y2) / 2, fontSize: this.#fontSize,