Fixing disappearing pages (when multiple are visible)

This commit is contained in:
notmasteryet 2011-10-08 21:06:14 -05:00
parent a1507893e8
commit 08f3fc45e0

View File

@ -16,6 +16,9 @@ var kMaxScale = 4.0;
var Cache = function cacheCache(size) {
var data = [];
this.push = function cachePush(view) {
var i = data.indexOf(view);
if (i >= 0)
data.splice(i);
data.push(view);
if (data.length > size)
data.shift().update();
@ -277,7 +280,6 @@ var PDFView = {
view: singlePage });
currentHeight += singlePage.height * singlePage.scale + kBottomMargin;
}
return visiblePages;
}
};