Skip to content

Commit 026bddc

Browse files
authored
Merge pull request #1230 from cdrini/1130/fix/1up-initial-zoom
2 parents 9fbd1d8 + dc92d0a commit 026bddc

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/BookReader/Mode1Up.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export class Mode1Up {
7777
jumpToIndex(index, pageX, pageY, noAnimate) {
7878
// Only smooth for small distances
7979
const distance = Math.abs(this.br.currentIndex() - index);
80-
const smooth = !noAnimate && distance <= 4;
80+
const smooth = !noAnimate && distance > 0 && distance <= 4;
8181
this.mode1UpLit.jumpToIndex(index, { smooth });
8282
}
8383

src/BookReader/Mode1UpLit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ export class Mode1UpLit extends LitElement {
350350
*/
351351
computeDefaultScale(page) {
352352
// Default to real size if it fits, otherwise default to full width
353-
const containerWidthIn = this.coordSpace.visiblePixelsToWorldUnits(this.htmlDimensionsCacher.clientWidth);
353+
const containerWidthIn = this.coordSpace.renderedPixelsToWorldUnits(this.clientWidth);
354354
return Math.min(1, containerWidthIn / (page.widthInches + 2 * this.SPACING_IN)) || 1;
355355
}
356356

0 commit comments

Comments
 (0)