refactor: Update QLine constructor to include default option for isActiveLengthText

This commit is contained in:
yoosangwook 2024-07-18 09:47:28 +09:00
parent edfa72bf48
commit 7913c46c70

View File

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