mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 07:08:08 +02:00
Convert some properties, on PDFThumbnailView
-instances, to local variables
These properties are always updated/used together, and there's no other methods which depend on just one of them, hence they're changed into local variables instead. Looking through the history of this code, it seems they were converted *from* local variables and to properties all the way back in PR 2914; however as far as I can tell from that diff it doesn't seem to have been necessary even back then!?
This commit is contained in:
parent
6429ccc002
commit
8ea83f7030
1 changed files with 10 additions and 10 deletions
|
@ -122,13 +122,13 @@ class PDFThumbnailView {
|
|||
};
|
||||
this.disableCanvasToImageConversion = disableCanvasToImageConversion;
|
||||
|
||||
this.pageWidth = this.viewport.width;
|
||||
this.pageHeight = this.viewport.height;
|
||||
this.pageRatio = this.pageWidth / this.pageHeight;
|
||||
const pageWidth = this.viewport.width,
|
||||
pageHeight = this.viewport.height,
|
||||
pageRatio = pageWidth / pageHeight;
|
||||
|
||||
this.canvasWidth = THUMBNAIL_WIDTH;
|
||||
this.canvasHeight = (this.canvasWidth / this.pageRatio) | 0;
|
||||
this.scale = this.canvasWidth / this.pageWidth;
|
||||
this.canvasHeight = (this.canvasWidth / pageRatio) | 0;
|
||||
this.scale = this.canvasWidth / pageWidth;
|
||||
|
||||
this.l10n = l10n;
|
||||
|
||||
|
@ -172,12 +172,12 @@ class PDFThumbnailView {
|
|||
this.cancelRendering();
|
||||
this.renderingState = RenderingStates.INITIAL;
|
||||
|
||||
this.pageWidth = this.viewport.width;
|
||||
this.pageHeight = this.viewport.height;
|
||||
this.pageRatio = this.pageWidth / this.pageHeight;
|
||||
const pageWidth = this.viewport.width,
|
||||
pageHeight = this.viewport.height,
|
||||
pageRatio = pageWidth / pageHeight;
|
||||
|
||||
this.canvasHeight = (this.canvasWidth / this.pageRatio) | 0;
|
||||
this.scale = this.canvasWidth / this.pageWidth;
|
||||
this.canvasHeight = (this.canvasWidth / pageRatio) | 0;
|
||||
this.scale = this.canvasWidth / pageWidth;
|
||||
|
||||
this.div.removeAttribute("data-loaded");
|
||||
const ring = this.ring;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue