From 7913c46c70c2b635d2fc2b8e119480527ee0e87d Mon Sep 17 00:00:00 2001 From: yoosangwook Date: Thu, 18 Jul 2024 09:47:28 +0900 Subject: [PATCH] refactor: Update QLine constructor to include default option for isActiveLengthText --- src/components/fabric/QLine.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/fabric/QLine.js b/src/components/fabric/QLine.js index 9ccb1a5c..7c732617 100644 --- a/src/components/fabric/QLine.js +++ b/src/components/fabric/QLine.js @@ -14,7 +14,7 @@ export class QLine extends fabric.Group { parent #lengthTxt = 0 - constructor(points, option, lengthTxt) { + constructor(points, option = { isActiveLengthText: true }, lengthTxt) { const [x1, y1, x2, y2] = points if (!option.fontSize) { @@ -37,7 +37,7 @@ export class QLine extends fabric.Group { this.#lengthTxt = Number(lengthTxt) } - this.#init() + option.isActiveLengthText ?? this.#init() this.#addControl() }