|
|
|
@ -9,6 +9,9 @@ window.customElements.define('draw-signature', class extends HTMLElement {
|
|
|
|
this.pad = new SignaturePad(this.canvas)
|
|
|
|
this.pad = new SignaturePad(this.canvas)
|
|
|
|
|
|
|
|
|
|
|
|
this.resizeObserver = new ResizeObserver(() => {
|
|
|
|
this.resizeObserver = new ResizeObserver(() => {
|
|
|
|
|
|
|
|
requestAnimationFrame(() => {
|
|
|
|
|
|
|
|
if (!this.canvas) return
|
|
|
|
|
|
|
|
|
|
|
|
const { width, height } = this.canvas
|
|
|
|
const { width, height } = this.canvas
|
|
|
|
|
|
|
|
|
|
|
|
this.setCanvasSize()
|
|
|
|
this.setCanvasSize()
|
|
|
|
@ -17,6 +20,7 @@ window.customElements.define('draw-signature', class extends HTMLElement {
|
|
|
|
this.redrawCanvas(width, height)
|
|
|
|
this.redrawCanvas(width, height)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
this.resizeObserver.observe(this.canvas.parentNode)
|
|
|
|
this.resizeObserver.observe(this.canvas.parentNode)
|
|
|
|
|
|
|
|
|
|
|
|
|