E-book viewer: Fix incorrect page turning when multiple pages are displayed on screen for books that wrap all their content in a single 100% height <div>. Fixes #1594657 [Private bug](https://bugs.launchpad.net/calibre/+bug/1594657)

This commit is contained in:
Kovid Goyal 2016-06-23 09:30:40 +05:30
parent 7f76d0292f
commit b13f5db607
3 changed files with 14 additions and 0 deletions

Binary file not shown.

View File

@ -140,6 +140,13 @@ class PagedDisplay
first_layout = true
if not single_screen and this.cols_per_screen > 1
num = this.cols_per_screen - 1
elems = document.querySelectorAll('body > *')
if elems.length == 1
# Workaround for the case when the content is wrapped in a
# 100% height <div>. This causes the generated page divs to
# not be in the correct location. See
# https://bugs.launchpad.net/bugs/1594657 for an example.
elems[0].style.height = 'auto'
while num > 0
num -= 1
create_page_div()

View File

@ -114,6 +114,13 @@ def layout(is_single_page):
first_layout = True
if not single_screen and opts.cols_per_screen > 1:
num = opts.cols_per_screen - 1
elems = document.querySelectorAll('body > *')
if elems.length == 1:
# Workaround for the case when the content is wrapped in a
# 100% height <div>. This causes the generated page divs to
# not be in the correct location, at least in WebKit. See
# https://bugs.launchpad.net/bugs/1594657 for an example.
elems[0].style.height = 'auto'
while num > 0:
num -= 1
create_page_div()