fix canvas error

This commit is contained in:
Pete Matsyburka
2026-04-30 14:42:22 +03:00
parent e0dc33cfb4
commit bf6eed4ea2
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -89,7 +89,7 @@ window.customElements.define('draw-signature', class extends HTMLElement {
}
redrawCanvas (oldWidth, oldHeight) {
if (this.pad && !this.pad.isEmpty() && oldWidth > 0 && oldHeight > 0) {
if (this.pad && !this.pad.isEmpty() && oldWidth > 0 && oldHeight > 0 && this.canvas.width > 0 && this.canvas.height > 0) {
const sx = this.canvas.width / oldWidth
const sy = this.canvas.height / oldHeight