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