저장 후 불러올 때 lines attributes 세팅

This commit is contained in:
hyojun.choi 2025-02-21 17:09:46 +09:00
parent 476e2f7cbc
commit 0ae09e17dd

View File

@ -162,9 +162,10 @@ export const QPolygon = fabric.util.createClass(fabric.Polygon, {
},
initLines() {
// if (this.lines.length > 0) {
// return
// }
let attributes = null
if (this.lines.length > 0) {
attributes = this.lines.map((line) => line.attributes)
}
this.lines = []
@ -174,9 +175,11 @@ export const QPolygon = fabric.util.createClass(fabric.Polygon, {
stroke: this.stroke,
strokeWidth: this.strokeWidth,
fontSize: this.fontSize,
attributes: {
offset: 0,
},
attributes: attributes
? attributes[i]
: {
offset: 0,
},
textVisible: false,
parent: this,
parentId: this.id,