refactor: Update QLine constructor to include default option for isActiveLengthText
This commit is contained in:
parent
edfa72bf48
commit
7913c46c70
@ -14,7 +14,7 @@ export class QLine extends fabric.Group {
|
|||||||
parent
|
parent
|
||||||
#lengthTxt = 0
|
#lengthTxt = 0
|
||||||
|
|
||||||
constructor(points, option, lengthTxt) {
|
constructor(points, option = { isActiveLengthText: true }, lengthTxt) {
|
||||||
const [x1, y1, x2, y2] = points
|
const [x1, y1, x2, y2] = points
|
||||||
|
|
||||||
if (!option.fontSize) {
|
if (!option.fontSize) {
|
||||||
@ -37,7 +37,7 @@ export class QLine extends fabric.Group {
|
|||||||
this.#lengthTxt = Number(lengthTxt)
|
this.#lengthTxt = Number(lengthTxt)
|
||||||
}
|
}
|
||||||
|
|
||||||
this.#init()
|
option.isActiveLengthText ?? this.#init()
|
||||||
this.#addControl()
|
this.#addControl()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user