[Regression] Avoid showing a black canvas during zooming with a drawingDelay set (PR 15812 follow-up)

After the changes in PR 15812 we'll now *intermittently* display completely black canvases during zooming. To reproduce this, try switching to wrapped-scrolling and zoom in/out very quickly using either the mouse-wheel or pinching.
This commit is contained in:
Jonas Jenwald 2023-01-14 23:15:15 +01:00
parent 517d7a6dc3
commit 906745de38

View File

@ -1071,7 +1071,12 @@ class PDFPageView {
renderCapability.resolve();
},
function (error) {
showCanvas();
// When zooming with a `drawingDelay` set, avoid temporarily showing
// a black canvas if rendering was cancelled before the `onContinue`-
// callback had been invoked at least once.
if (!(error instanceof RenderingCancelledException)) {
showCanvas();
}
renderCapability.reject(error);
}
);