Skip to content

Commit

Permalink
Don't use a hidden canvas when constructing the zoomLayer in `PDFPa…
Browse files Browse the repository at this point in the history
…geView.update`

*This is an existing issue that I noticed while testing PR 8552.*

When zooming or rotation occurs, we'll try to use the current canvas as a (CSS transformed) preview until the page has been completely re-drawn.
If you manage to change the scale (or rotation) *very* quickly, it's possible that `PDFPageView.update` can be called *before* a previous `render` operation has progressed far enough to remove the `hidden` property from the canvas.

The result is thus that a page may be *entirely* black during zooming or rotation, which doesn't look very good. This effect can be a bit difficult to spot, but it does manifest even in the default viewer.
  • Loading branch information
Snuffleupagus committed Jun 22, 2017
1 parent 36fb368 commit 426e26c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion web/pdf_page_view.js
Expand Up @@ -230,7 +230,7 @@ class PDFPageView {
});
return;
}
if (!this.zoomLayer) {
if (!this.zoomLayer && !this.canvas.hasAttribute('hidden')) {
this.zoomLayer = this.canvas.parentNode;
this.zoomLayer.style.position = 'absolute';
}
Expand Down

0 comments on commit 426e26c

Please sign in to comment.