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.height = (canvas_height < window.innerHeight) ? window.innerHeight : canvas_height;
|
||||
|
||||
// work out a horizontal position that will keep the pages always centred
|
||||
if (canvas_width < windowWidth() && options.zoomMode === 'manual') {
|
||||
offsetW = (windowWidth() - page_width) / 2;
|
||||
if (options.displayMode === 'double') { offsetW = offsetW - page_width / 2; }
|
||||
}
|
||||
// always keep pages centered
|
||||
if (options.zoomMode === 'manual' || options.zoomMode === 'fitWindow') {
|
||||
|
||||
// work out a vertical position that will keep the pages always centred
|
||||
if (canvas_height < window.innerHeight && options.zoomMode === 'manual') {
|
||||
offsetH = (window.innerHeight - page_height) / 2;
|
||||
// work out a horizontal position
|
||||
if (canvas_width < windowWidth()) {
|
||||
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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue