Fix scroll to zoom jump between 25% and 1000%

This commit is contained in:
Xiliang Chen 2015-05-14 15:27:56 +12:00
parent d484ebd492
commit ed540a8d00

View File

@ -291,7 +291,7 @@ var PDFViewerApplication = {
newScale = (newScale * DEFAULT_SCALE_DELTA).toFixed(2); newScale = (newScale * DEFAULT_SCALE_DELTA).toFixed(2);
newScale = Math.ceil(newScale * 10) / 10; newScale = Math.ceil(newScale * 10) / 10;
newScale = Math.min(MAX_SCALE, newScale); newScale = Math.min(MAX_SCALE, newScale);
} while (--ticks && newScale < MAX_SCALE); } while (--ticks > 0 && newScale < MAX_SCALE);
this.setScale(newScale, true); this.setScale(newScale, true);
}, },
@ -301,7 +301,7 @@ var PDFViewerApplication = {
newScale = (newScale / DEFAULT_SCALE_DELTA).toFixed(2); newScale = (newScale / DEFAULT_SCALE_DELTA).toFixed(2);
newScale = Math.floor(newScale * 10) / 10; newScale = Math.floor(newScale * 10) / 10;
newScale = Math.max(MIN_SCALE, newScale); newScale = Math.max(MIN_SCALE, newScale);
} while (--ticks && newScale > MIN_SCALE); } while (--ticks > 0 && newScale > MIN_SCALE);
this.setScale(newScale, true); this.setScale(newScale, true);
}, },