우선 컨트롤 제거

This commit is contained in:
hyojun.choi 2024-07-05 16:56:02 +09:00
parent 394136af4c
commit f6b586cb77

View File

@ -19,10 +19,12 @@ export default class QPolygon extends fabric.Group {
const polygon = new fabric.Polygon(points, options) const polygon = new fabric.Polygon(points, options)
super([polygon], {}) super([polygon], {})
this.fontSize = options.fontSize this.fontSize = options.fontSize
this.points = points this.points = points
this.polygon = polygon this.polygon = polygon
this.canvas = canvas this.canvas = canvas
this.#init() this.#init()
this.#addEvent() this.#addEvent()
} }
@ -35,6 +37,11 @@ export default class QPolygon extends fabric.Group {
this.on('scaling', (e) => { this.on('scaling', (e) => {
this.#updateLengthText() this.#updateLengthText()
}) })
this.on('selected', function () {
// 모든 컨트롤 떼기
this.controls = []
})
} }
setFontSize(fontSize) { setFontSize(fontSize) {