keep pages centred in fitWidth mode.
This commit is contained in:
parent
a730b56faf
commit
628dadf370
1 changed files with 12 additions and 8 deletions
|
@ -543,15 +543,19 @@ var ComicBook = (function ($) {
|
||||||
canvas.width = (canvas_width < windowWidth()) ? windowWidth() : canvas_width;
|
canvas.width = (canvas_width < windowWidth()) ? windowWidth() : canvas_width;
|
||||||
canvas.height = (canvas_height < window.innerHeight) ? window.innerHeight : canvas_height;
|
canvas.height = (canvas_height < window.innerHeight) ? window.innerHeight : canvas_height;
|
||||||
|
|
||||||
// work out a horizontal position that will keep the pages always centred
|
// always keep pages centered
|
||||||
if (canvas_width < windowWidth() && options.zoomMode === 'manual') {
|
if (options.zoomMode === 'manual' || options.zoomMode === 'fitWindow') {
|
||||||
offsetW = (windowWidth() - page_width) / 2;
|
|
||||||
if (options.displayMode === 'double') { offsetW = offsetW - page_width / 2; }
|
|
||||||
}
|
|
||||||
|
|
||||||
// work out a vertical position that will keep the pages always centred
|
// work out a horizontal position
|
||||||
if (canvas_height < window.innerHeight && options.zoomMode === 'manual') {
|
if (canvas_width < windowWidth()) {
|
||||||
offsetH = (window.innerHeight - page_height) / 2;
|
offsetW = (windowWidth() - page_width) / 2;
|
||||||
|
if (options.displayMode === 'double') { offsetW = offsetW - page_width / 2; }
|
||||||
|
}
|
||||||
|
|
||||||
|
// work out a vertical position
|
||||||
|
if (canvas_height < window.innerHeight) {
|
||||||
|
offsetH = (window.innerHeight - page_height) / 2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// in manga double page mode reverse the page(s)
|
// in manga double page mode reverse the page(s)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue