mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 17:55:37 +02:00
Merge pull request #2705 from timvandermeij/even-zooming
More even way of zooming
This commit is contained in:
commit
a7f385971d
1 changed files with 2 additions and 0 deletions
|
@ -817,12 +817,14 @@ var PDFView = {
|
||||||
|
|
||||||
zoomIn: function pdfViewZoomIn() {
|
zoomIn: function pdfViewZoomIn() {
|
||||||
var newScale = (this.currentScale * DEFAULT_SCALE_DELTA).toFixed(2);
|
var newScale = (this.currentScale * DEFAULT_SCALE_DELTA).toFixed(2);
|
||||||
|
newScale = Math.ceil(newScale * 10) / 10;
|
||||||
newScale = Math.min(MAX_SCALE, newScale);
|
newScale = Math.min(MAX_SCALE, newScale);
|
||||||
this.parseScale(newScale, true);
|
this.parseScale(newScale, true);
|
||||||
},
|
},
|
||||||
|
|
||||||
zoomOut: function pdfViewZoomOut() {
|
zoomOut: function pdfViewZoomOut() {
|
||||||
var newScale = (this.currentScale / DEFAULT_SCALE_DELTA).toFixed(2);
|
var newScale = (this.currentScale / DEFAULT_SCALE_DELTA).toFixed(2);
|
||||||
|
newScale = Math.floor(newScale * 10) / 10;
|
||||||
newScale = Math.max(MIN_SCALE, newScale);
|
newScale = Math.max(MIN_SCALE, newScale);
|
||||||
this.parseScale(newScale, true);
|
this.parseScale(newScale, true);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue