From e57784f1a1b39643ce0f59b478810569b430adb9 Mon Sep 17 00:00:00 2001 From: Bala Clark Date: Thu, 8 Jul 2010 00:50:55 +0100 Subject: [PATCH] fixed page height bug in manual mode --- scripts.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts.js b/scripts.js index b934c57..16111c2 100644 --- a/scripts.js +++ b/scripts.js @@ -20,6 +20,7 @@ window.onload = function() { book = new ComicBook("comic", pages, options); book.draw(); + book.zoom(.5); } window.onresize = function() { @@ -109,7 +110,8 @@ function ComicBook(id, srcs, opts) { ComicBook.prototype.drawPage = function() { var zoom_scale; - var offsetW = 0; + var offsetW = 0, offsetH = 0; + var page = pages[pointer]; var page2 = pages[pointer + 1]; @@ -148,6 +150,8 @@ function ComicBook(id, srcs, opts) { var page_width = (options.zoomMode == "manual") ? page.width * scale : canvas_width; var page_height = (options.zoomMode == "manual") ? page.height * scale : canvas_height; + canvas_height = page_height; + // make sure the canvas is always at least full screen, even if the page is more narrow than the screen canvas.width = (canvas_width < window.innerWidth) ? window.innerWidth : canvas_width; canvas.height = (canvas_height < window.innerHeight) ? window.innerHeight : canvas_height;