made switching from auto page width to manual zoom modes smoother

This commit is contained in:
Bala Clark 2011-09-03 08:31:24 +02:00
parent b3443a93fc
commit 130463606c

View file

@ -486,8 +486,13 @@ function ComicBook(id, srcs, opts) {
case "fitWidth":
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;
default: