From 130463606ca835e4a43f155c9511f20b0c872124 Mon Sep 17 00:00:00 2001 From: Bala Clark Date: Sat, 3 Sep 2011 08:31:24 +0200 Subject: [PATCH] made switching from auto page width to manual zoom modes smoother --- lib/ComicBook.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/ComicBook.js b/lib/ComicBook.js index 71bd4c1..a16105d 100755 --- a/lib/ComicBook.js +++ b/lib/ComicBook.js @@ -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: