mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 22:58:07 +02:00
Cache pages at the start of drawing, not the end.
This commit is contained in:
parent
06cdca4576
commit
29d3db4422
1 changed files with 4 additions and 2 deletions
|
@ -591,8 +591,6 @@ var PageView = function pageView(container, id, scale,
|
|||
self.onAfterDraw();
|
||||
}
|
||||
|
||||
cache.push(self);
|
||||
|
||||
var event = document.createEvent('CustomEvent');
|
||||
event.initCustomEvent('pagerender', true, true, {
|
||||
pageNumber: pdfPage.pageNumber
|
||||
|
@ -645,6 +643,10 @@ var PageView = function pageView(container, id, scale,
|
|||
|
||||
setupAnnotations(div, pdfPage, this.viewport);
|
||||
div.setAttribute('data-loaded', true);
|
||||
|
||||
// Add the page to the cache at the start of drawing. That way it can be
|
||||
// evicted from the cache and destroyed even if we pause its rendering.
|
||||
cache.push(this);
|
||||
};
|
||||
|
||||
this.beforePrint = function pageViewBeforePrint() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue