mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
Fix CSS-only zooming in the viewer (PR 15812 follow-up)
Currently if you e.g. enable the `useOnlyCssZoom` option rendering may no longer finish as intended. To reproduce:
- Enable the `useOnlyCssZoom` option.
- Load 1522715/wuppertal_2012.pdf
(in the development viewer).
- When rendering starts, *immediately* change the zoom-level.
In this case the document will never finish rendering, since the `postponeDrawing`-functionality will (here incorrectly) abort rendering and with CSS-only zooming rendering is only expected to happen once per page.
To fix this we'll simply ignore any `drawingDelay` when CSS-only zooming is used (regardless if it's triggered via the option or the zoom-level being very large).
This commit is contained in:
parent
2c5a2d112c
commit
7bca3c81a9
1 changed files with 5 additions and 6 deletions
|
@ -607,14 +607,13 @@ class PDFPageView {
|
|||
isScalingRestricted = true;
|
||||
}
|
||||
}
|
||||
const postponeDrawing = drawingDelay >= 0 && drawingDelay < 1000;
|
||||
const onlyCssZoom =
|
||||
this.useOnlyCssZoom || (this.hasRestrictedScaling && isScalingRestricted);
|
||||
const postponeDrawing =
|
||||
!onlyCssZoom && drawingDelay >= 0 && drawingDelay < 1000;
|
||||
|
||||
if (this.canvas) {
|
||||
if (
|
||||
postponeDrawing ||
|
||||
this.useOnlyCssZoom ||
|
||||
(this.hasRestrictedScaling && isScalingRestricted)
|
||||
) {
|
||||
if (postponeDrawing || onlyCssZoom) {
|
||||
if (
|
||||
postponeDrawing &&
|
||||
this.renderingState !== RenderingStates.FINISHED
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue