Merge pull request from notmasteryet/tree-29

Fixing disappearing pages (when multiple are visible)
This commit is contained in:
Andreas Gal 2011-10-08 23:38:26 -07:00
commit ccf1e94a7d

@ -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;
}
};