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
@ -122,13 +122,13 @@ class PDFThumbnailView {
|
|||||||
};
|
};
|
||||||
this.disableCanvasToImageConversion = disableCanvasToImageConversion;
|
this.disableCanvasToImageConversion = disableCanvasToImageConversion;
|
||||||
|
|
||||||
this.pageWidth = this.viewport.width;
|
const pageWidth = this.viewport.width,
|
||||||
this.pageHeight = this.viewport.height;
|
pageHeight = this.viewport.height,
|
||||||
this.pageRatio = this.pageWidth / this.pageHeight;
|
pageRatio = pageWidth / pageHeight;
|
||||||
|
|
||||||
this.canvasWidth = THUMBNAIL_WIDTH;
|
this.canvasWidth = THUMBNAIL_WIDTH;
|
||||||
this.canvasHeight = (this.canvasWidth / this.pageRatio) | 0;
|
this.canvasHeight = (this.canvasWidth / pageRatio) | 0;
|
||||||
this.scale = this.canvasWidth / this.pageWidth;
|
this.scale = this.canvasWidth / pageWidth;
|
||||||
|
|
||||||
this.l10n = l10n;
|
this.l10n = l10n;
|
||||||
|
|
||||||
@ -172,12 +172,12 @@ class PDFThumbnailView {
|
|||||||
this.cancelRendering();
|
this.cancelRendering();
|
||||||
this.renderingState = RenderingStates.INITIAL;
|
this.renderingState = RenderingStates.INITIAL;
|
||||||
|
|
||||||
this.pageWidth = this.viewport.width;
|
const pageWidth = this.viewport.width,
|
||||||
this.pageHeight = this.viewport.height;
|
pageHeight = this.viewport.height,
|
||||||
this.pageRatio = this.pageWidth / this.pageHeight;
|
pageRatio = pageWidth / pageHeight;
|
||||||
|
|
||||||
this.canvasHeight = (this.canvasWidth / this.pageRatio) | 0;
|
this.canvasHeight = (this.canvasWidth / pageRatio) | 0;
|
||||||
this.scale = this.canvasWidth / this.pageWidth;
|
this.scale = this.canvasWidth / pageWidth;
|
||||||
|
|
||||||
this.div.removeAttribute("data-loaded");
|
this.div.removeAttribute("data-loaded");
|
||||||
const ring = this.ring;
|
const ring = this.ring;
|
||||||
|
Loading…
Reference in New Issue
Block a user