Merge pull request #4292 from Snuffleupagus/issue-4232
Fix wrong page being displayed when entering/exiting Presentation mode with zoom set to 'page-fit'
This commit is contained in:
commit
6cce1e44dd
@ -329,7 +329,12 @@ var PageView = function pageView(container, id, scale,
|
|||||||
};
|
};
|
||||||
|
|
||||||
this.scrollIntoView = function pageViewScrollIntoView(dest) {
|
this.scrollIntoView = function pageViewScrollIntoView(dest) {
|
||||||
if (PresentationMode.active) { // Avoid breaking presentation mode.
|
if (PresentationMode.active) {
|
||||||
|
if (PDFView.page !== this.id) {
|
||||||
|
// Avoid breaking PDFView.getVisiblePages in presentation mode.
|
||||||
|
PDFView.page = this.id;
|
||||||
|
return;
|
||||||
|
}
|
||||||
dest = null;
|
dest = null;
|
||||||
PDFView.setScale(PDFView.currentScaleValue, true, true);
|
PDFView.setScale(PDFView.currentScaleValue, true, true);
|
||||||
}
|
}
|
||||||
|
@ -1321,8 +1321,16 @@ var PDFView = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
getVisiblePages: function pdfViewGetVisiblePages() {
|
getVisiblePages: function pdfViewGetVisiblePages() {
|
||||||
return this.getVisibleElements(this.container, this.pages,
|
if (!PresentationMode.active) {
|
||||||
!PresentationMode.active);
|
return this.getVisibleElements(this.container, this.pages, true);
|
||||||
|
} else {
|
||||||
|
// The algorithm in getVisibleElements doesn't work in all browsers and
|
||||||
|
// configurations when presentation mode is active.
|
||||||
|
var visible = [];
|
||||||
|
var currentPage = this.pages[this.page - 1];
|
||||||
|
visible.push({ id: currentPage.id, view: currentPage });
|
||||||
|
return { first: currentPage, last: currentPage, views: visible };
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
getVisibleThumbs: function pdfViewGetVisibleThumbs() {
|
getVisibleThumbs: function pdfViewGetVisibleThumbs() {
|
||||||
@ -1871,9 +1879,11 @@ function updateViewarea() {
|
|||||||
currentId = visiblePages[0].id;
|
currentId = visiblePages[0].id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!PresentationMode.active) {
|
||||||
updateViewarea.inProgress = true; // used in "set page"
|
updateViewarea.inProgress = true; // used in "set page"
|
||||||
PDFView.page = currentId;
|
PDFView.page = currentId;
|
||||||
updateViewarea.inProgress = false;
|
updateViewarea.inProgress = false;
|
||||||
|
}
|
||||||
|
|
||||||
var currentScale = PDFView.currentScale;
|
var currentScale = PDFView.currentScale;
|
||||||
var currentScaleValue = PDFView.currentScaleValue;
|
var currentScaleValue = PDFView.currentScaleValue;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user