Merge pull request #2905 from yurydelendik/issue-2880

Takes clientTop in account in getVisibleElements
This commit is contained in:
Brendan Dahl 2013-03-07 13:48:13 -08:00
commit d17dc935a9

View File

@ -1608,7 +1608,7 @@ var PDFView = {
for (var i = 1, ii = views.length; i <= ii; ++i) { for (var i = 1, ii = views.length; i <= ii; ++i) {
view = views[i - 1]; view = views[i - 1];
currentHeight = view.el.offsetTop; currentHeight = view.el.offsetTop + view.el.clientTop;
if (currentHeight + view.el.clientHeight > top) if (currentHeight + view.el.clientHeight > top)
break; break;
currentHeight += view.el.clientHeight; currentHeight += view.el.clientHeight;
@ -1632,7 +1632,7 @@ var PDFView = {
for (; i <= ii && currentHeight < bottom; ++i) { for (; i <= ii && currentHeight < bottom; ++i) {
view = views[i - 1]; view = views[i - 1];
viewHeight = view.el.clientHeight; viewHeight = view.el.clientHeight;
currentHeight = view.el.offsetTop; currentHeight = view.el.offsetTop + view.el.clientTop;
nextHeight = currentHeight + viewHeight; nextHeight = currentHeight + viewHeight;
hidden = Math.max(0, top - currentHeight) + hidden = Math.max(0, top - currentHeight) +
Math.max(0, nextHeight - bottom); Math.max(0, nextHeight - bottom);