group에 추가

This commit is contained in:
hyojun.choi 2024-07-22 12:00:00 +09:00
parent 8089caafdf
commit 3b9abe4bb3

View File

@ -115,7 +115,7 @@ export default class QPolygon extends fabric.Group {
}
})
this.canvas.add()
this.addWithUpdate()
}
addLengthText() {
@ -144,7 +144,7 @@ export default class QPolygon extends fabric.Group {
})
this.texts.push(text)
this.canvas.add(text)
this.addWithUpdate(text)
})
this.canvas.renderAll()
@ -199,7 +199,7 @@ export default class QPolygon extends fabric.Group {
const isInside = rectPoints.every((rectPoint) => this.inPolygon(rectPoint) && this.distanceFromEdge(rectPoint) >= cell.padding)
if (isInside) {
this.canvas.add(rect)
this.addWithUpdate(rect)
}
}
}
@ -523,12 +523,12 @@ export default class QPolygon extends fabric.Group {
strokeWidth: 1,
})
this.canvas.add(realLine1)
this.canvas.add(realLine2)
this.canvas.add(realLine3)
this.canvas.add(realLine4)
this.canvas.add(realLine5)
this.canvas.add(realLine6)
this.addWithUpdate(realLine1)
this.addWithUpdate(realLine2)
this.addWithUpdate(realLine3)
this.addWithUpdate(realLine4)
this.addWithUpdate(realLine5)
this.addWithUpdate(realLine6)
if (smallestLength !== maxLength) {
// 정사각형이 아닌경우에만 용마루를 추가한다.
this.canvas.add(ridge)
@ -593,7 +593,7 @@ export default class QPolygon extends fabric.Group {
direction: 'horizontal',
})
// this.canvas.add(centerLine)
// this.addWithUpdate(centerLine)
centerLines.push(centerLine)
})
@ -618,7 +618,7 @@ export default class QPolygon extends fabric.Group {
strokeWidth: 1,
direction: 'vertical',
})
// this.canvas.add(centerLine)
// this.addWithUpdate(centerLine)
centerLines.push(centerLine)
})
@ -646,7 +646,7 @@ export default class QPolygon extends fabric.Group {
stroke: 'green',
idx: index,
})
this.canvas.add(line)
this.addWithUpdate(line)
helpLines.push(line)
this.canvas.renderAll()
})
@ -677,10 +677,10 @@ export default class QPolygon extends fabric.Group {
})
ridgeStartPoints.push(intersectionPoint)
this.canvas.add(helpLine1)
this.canvas.add(helpLine2)
this.canvas.remove(nextLine)
this.canvas.remove(line)
this.addWithUpdate(helpLine1)
this.addWithUpdate(helpLine2)
this.removeWithUpdate(nextLine)
this.removeWithUpdate(line)
this.canvas.renderAll()
})
@ -731,9 +731,9 @@ export default class QPolygon extends fabric.Group {
})
ridgeEndPoints.push(arrivalPoint)
this.canvas.add(ridge)
this.canvas.add(helpLine)
this.canvas.remove(line)
this.addWithUpdate(ridge)
this.addWithUpdate(helpLine)
this.removeWithUpdate(line)
this.canvas.renderAll()
}
})
@ -746,7 +746,7 @@ export default class QPolygon extends fabric.Group {
stroke: 'green',
})
this.canvas.add(ridgeConnectLine)
this.addWithUpdate(ridgeConnectLine)
this.canvas.renderAll()
})
}
@ -778,7 +778,7 @@ export default class QPolygon extends fabric.Group {
idx: index,
})
historyLines.push(line)
this.canvas.add(line)
this.addWithUpdate(line)
this.canvas.renderAll()
})
@ -808,10 +808,10 @@ export default class QPolygon extends fabric.Group {
notInterSectionLines.pop()
helpPoints.push(intersectionPoint)
this.canvas.add(helpLine1)
this.canvas.add(helpLine2)
this.canvas.remove(prevLine)
this.canvas.remove(line)
this.addWithUpdate(helpLine1)
this.addWithUpdate(helpLine2)
this.removeWithUpdate(prevLine)
this.removeWithUpdate(line)
this.canvas.renderAll()
})
// 용마루
@ -868,11 +868,11 @@ export default class QPolygon extends fabric.Group {
strokeWidth: 5,
})
this.canvas.add(ridge)
this.addWithUpdate(ridge)
this.canvas.renderAll()
this.canvas.add(ridgeHelpLine)
this.canvas.remove(closestLine)
this.addWithUpdate(ridgeHelpLine)
this.removeWithUpdate(closestLine)
this.canvas.renderAll()
})
@ -885,7 +885,7 @@ export default class QPolygon extends fabric.Group {
stroke: 'green',
strokeWidth: 5,
})
this.canvas.add(ridgeConnectLine)
this.addWithUpdate(ridgeConnectLine)
this.canvas.renderAll()
}