Merge pull request #636 from notmasteryet/tree-29
Fixing disappearing pages (when multiple are visible)
This commit is contained in:
commit
ccf1e94a7d
@ -16,6 +16,9 @@ var kMaxScale = 4.0;
|
|||||||
var Cache = function cacheCache(size) {
|
var Cache = function cacheCache(size) {
|
||||||
var data = [];
|
var data = [];
|
||||||
this.push = function cachePush(view) {
|
this.push = function cachePush(view) {
|
||||||
|
var i = data.indexOf(view);
|
||||||
|
if (i >= 0)
|
||||||
|
data.splice(i);
|
||||||
data.push(view);
|
data.push(view);
|
||||||
if (data.length > size)
|
if (data.length > size)
|
||||||
data.shift().update();
|
data.shift().update();
|
||||||
@ -277,7 +280,6 @@ var PDFView = {
|
|||||||
view: singlePage });
|
view: singlePage });
|
||||||
currentHeight += singlePage.height * singlePage.scale + kBottomMargin;
|
currentHeight += singlePage.height * singlePage.scale + kBottomMargin;
|
||||||
}
|
}
|
||||||
|
|
||||||
return visiblePages;
|
return visiblePages;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user