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) {
|
||||
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;
|
||||
PDFView.setScale(PDFView.currentScaleValue, true, true);
|
||||
}
|
||||
|
@ -1321,8 +1321,16 @@ var PDFView = {
|
||||
},
|
||||
|
||||
getVisiblePages: function pdfViewGetVisiblePages() {
|
||||
return this.getVisibleElements(this.container, this.pages,
|
||||
!PresentationMode.active);
|
||||
if (!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() {
|
||||
@ -1871,9 +1879,11 @@ function updateViewarea() {
|
||||
currentId = visiblePages[0].id;
|
||||
}
|
||||
|
||||
updateViewarea.inProgress = true; // used in "set page"
|
||||
PDFView.page = currentId;
|
||||
updateViewarea.inProgress = false;
|
||||
if (!PresentationMode.active) {
|
||||
updateViewarea.inProgress = true; // used in "set page"
|
||||
PDFView.page = currentId;
|
||||
updateViewarea.inProgress = false;
|
||||
}
|
||||
|
||||
var currentScale = PDFView.currentScale;
|
||||
var currentScaleValue = PDFView.currentScaleValue;
|
||||
|
Loading…
x
Reference in New Issue
Block a user