made switching from auto page width to manual zoom modes smoother
This commit is contained in:
parent
b3443a93fc
commit
130463606c
1 changed files with 7 additions and 2 deletions
|
@ -486,8 +486,13 @@ function ComicBook(id, srcs, opts) {
|
||||||
|
|
||||||
case "fitWidth":
|
case "fitWidth":
|
||||||
document.body.style.overflowX = "hidden";
|
document.body.style.overflowX = "hidden";
|
||||||
zoom_scale = (window.innerWidth > width) ? ((window.innerWidth - width) / window.innerWidth) + 1 // scale up if the window is wider than the page
|
|
||||||
: window.innerWidth / width; // scale down if the window is narrower than the page
|
zoom_scale = (window.innerWidth > width)
|
||||||
|
? ((window.innerWidth - width) / window.innerWidth) + 1 // scale up if the window is wider than the page
|
||||||
|
: window.innerWidth / width; // scale down if the window is narrower than the page
|
||||||
|
|
||||||
|
// update the interal scale var so switching zoomModes while zooming will be smooth
|
||||||
|
scale = zoom_scale
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue