fix Point is invalid

master^2
Pete Matsyburka 1 week ago
parent 96530bd809
commit 1e5f55c1d6

@ -89,7 +89,7 @@ window.customElements.define('draw-signature', class extends HTMLElement {
} }
redrawCanvas (oldWidth, oldHeight) { redrawCanvas (oldWidth, oldHeight) {
if (this.pad && !this.pad.isEmpty()) { if (this.pad && !this.pad.isEmpty() && oldWidth > 0 && oldHeight > 0) {
const sx = this.canvas.width / oldWidth const sx = this.canvas.width / oldWidth
const sy = this.canvas.height / oldHeight const sy = this.canvas.height / oldHeight

@ -80,7 +80,7 @@ export default targetable(class extends HTMLElement {
} }
redrawCanvas (oldWidth, oldHeight) { redrawCanvas (oldWidth, oldHeight) {
if (this.pad && !this.pad.isEmpty()) { if (this.pad && !this.pad.isEmpty() && oldWidth > 0 && oldHeight > 0) {
const sx = this.canvas.width / oldWidth const sx = this.canvas.width / oldWidth
const sy = this.canvas.height / oldHeight const sy = this.canvas.height / oldHeight

@ -514,7 +514,7 @@ export default {
redrawCanvas (oldWidth, oldHeight) { redrawCanvas (oldWidth, oldHeight) {
const canvas = this.$refs.canvas const canvas = this.$refs.canvas
if (this.pad && !this.isTextSignature && !this.pad.isEmpty()) { if (this.pad && !this.isTextSignature && !this.pad.isEmpty() && oldWidth > 0 && oldHeight > 0) {
const sx = canvas.width / oldWidth const sx = canvas.width / oldWidth
const sy = canvas.height / oldHeight const sy = canvas.height / oldHeight

Loading…
Cancel
Save