From e64541e3bf1d0e2da174d2d5bb5f73e163222994 Mon Sep 17 00:00:00 2001 From: Benjamin Kane Date: Wed, 22 Mar 2023 11:24:23 -0600 Subject: [PATCH] return on no bbox --- app/packages/looker/src/elements/common/canvas.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/app/packages/looker/src/elements/common/canvas.ts b/app/packages/looker/src/elements/common/canvas.ts index 631c9a39c5..a02edbc9df 100644 --- a/app/packages/looker/src/elements/common/canvas.ts +++ b/app/packages/looker/src/elements/common/canvas.ts @@ -14,11 +14,11 @@ export class CanvasElement extends BaseElement< State, HTMLCanvasElement > { - private width: number = 0; - private height: number = 0; - private hide: boolean = true; + private width = 0; + private height = 0; + private hide = true; private mousedownCoordinates?: Coordinates; - private mousedown: boolean = false; + private mousedown = false; private start: Coordinates = [0, 0]; private wheelTimeout: ReturnType | null = null; private cursor: string; @@ -186,10 +186,14 @@ export class CanvasElement extends BaseElement< disabled, config: { thumbnail }, panning, - windowBBox: [_, __, width, height], + windowBBox, mouseIsOnOverlay, disableOverlays, }: Readonly) { + if (!windowBBox) { + return this.element; + } + const [_, __, width, height] = windowBBox; if (this.width !== width) { const dpr = getDPR(); this.element.width = width * dpr;