fix signature canvas minimize
This commit is contained in:
@@ -11,6 +11,7 @@ window.customElements.define('draw-signature', class extends HTMLElement {
|
|||||||
this.resizeObserver = new ResizeObserver(() => {
|
this.resizeObserver = new ResizeObserver(() => {
|
||||||
requestAnimationFrame(() => {
|
requestAnimationFrame(() => {
|
||||||
if (!this.canvas) return
|
if (!this.canvas) return
|
||||||
|
if (!this.canvas.parentNode?.clientWidth) return
|
||||||
|
|
||||||
const { width, height } = this.canvas
|
const { width, height } = this.canvas
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ export default targetable(class extends HTMLElement {
|
|||||||
this.resizeObserver = new ResizeObserver(() => {
|
this.resizeObserver = new ResizeObserver(() => {
|
||||||
requestAnimationFrame(() => {
|
requestAnimationFrame(() => {
|
||||||
if (!this.canvas) return
|
if (!this.canvas) return
|
||||||
|
if (!this.canvas.parentNode?.clientWidth) return
|
||||||
|
|
||||||
const { width, height } = this.canvas
|
const { width, height } = this.canvas
|
||||||
|
|
||||||
|
|||||||
@@ -544,6 +544,7 @@ export default {
|
|||||||
this.resizeObserver = new ResizeObserver(() => {
|
this.resizeObserver = new ResizeObserver(() => {
|
||||||
requestAnimationFrame(() => {
|
requestAnimationFrame(() => {
|
||||||
if (!this.$refs.canvas) return
|
if (!this.$refs.canvas) return
|
||||||
|
if (!this.$refs.canvas.parentNode?.clientWidth) return
|
||||||
|
|
||||||
const { width, height } = this.$refs.canvas
|
const { width, height } = this.$refs.canvas
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user