Skip to content

Commit

Permalink
Merge pull request #32 from batman-nair/master
Browse files Browse the repository at this point in the history
Add a fallback for client width calc
  • Loading branch information
MSzturc authored Nov 8, 2022
2 parents 860be22 + 970e677 commit 4c2db40
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export default class BetterPDFPlugin extends Plugin {
const context = canvas.getContext("2d");

const baseViewportWidth = page.getViewport({scale: 1.0}).width;
const baseScale = canvas.clientWidth / baseViewportWidth;
const baseScale = canvas.clientWidth ? canvas.clientWidth / baseViewportWidth : 1;

const viewport = page.getViewport({
scale: baseScale * parameters.scale,
Expand Down

0 comments on commit 4c2db40

Please sign in to comment.