Skip to content

Commit

Permalink
return on no bbox
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminpkane committed Mar 22, 2023
1 parent e7ef404 commit e64541e
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions app/packages/looker/src/elements/common/canvas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ export class CanvasElement<State extends BaseState> 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<typeof setTimeout> | null = null;
private cursor: string;
Expand Down Expand Up @@ -186,10 +186,14 @@ export class CanvasElement<State extends BaseState> extends BaseElement<
disabled,
config: { thumbnail },
panning,
windowBBox: [_, __, width, height],
windowBBox,
mouseIsOnOverlay,
disableOverlays,
}: Readonly<State>) {
if (!windowBBox) {
return this.element;
}
const [_, __, width, height] = windowBBox;
if (this.width !== width) {
const dpr = getDPR();
this.element.width = width * dpr;
Expand Down

0 comments on commit e64541e

Please sign in to comment.