Skip to content

Commit

Permalink
Fix fluctuating annotation alignment on page affected by DPI and zoom
Browse files Browse the repository at this point in the history
  • Loading branch information
mrtcode committed Nov 1, 2023
1 parent 4b079bf commit 439aacd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pdfjs/pdf.js
Submodule pdf.js updated 1 files
+1 −0 web/pdf_page_view.js
2 changes: 1 addition & 1 deletion src/pdf/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default class Page {

// PDF to Canvas transform
get transform() {
let scale = parseFloat(this.originalCanvas.width) / this.originalPage.viewport.width;
let scale = this.originalPage.currentCanvasWidth / this.originalPage.viewport.width;
let scaleTransform = [scale, 0, 0, scale, 0, 0];
return transform(scaleTransform, this.originalPage.viewport.transform);
}
Expand Down

0 comments on commit 439aacd

Please sign in to comment.