From b13f5db6079cb706b1b635e68611faad23753942 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 23 Jun 2016 09:30:40 +0530 Subject: [PATCH] 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
. Fixes #1594657 [Private bug](https://bugs.launchpad.net/calibre/+bug/1594657) --- resources/compiled_coffeescript.zip | Bin 101036 -> 101192 bytes src/calibre/ebooks/oeb/display/paged.coffee | 7 +++++++ src/pyj/read_book/paged_mode.pyj | 7 +++++++ 3 files changed, 14 insertions(+) diff --git a/resources/compiled_coffeescript.zip b/resources/compiled_coffeescript.zip index 542fa626624c5479de471ec0968d050b0182709a..ed1efb290d1474852be02a7136176d700102ccc8 100644 GIT binary patch delta 332 zcmZ28mF>hdwhiC+@@?_H?!mim!K3(W28Q_T>5Q6;lAGoB@kz3#=A`BpZ`Qg#n+d|4 zzCNE(E-EQMrBcC8K}%iJno9u=GSd_^!0PpKQuESFG8AlWZ50eP6{?ZcC@6qcL>t8F z6_-@zr0Qj)W~OJ9DA+2fCzh7vt50rREVlXZP42bmPP)^^7|GPCIo-US(Vg+w^!j#2 z4<>ET=?(3SBGdPKFmg?Q-p(k%@vN1RVLel|(nLAQ>Hj(y`=SDB>{-FcN zTHV3uJ6*Pok#G8}PDba+a{D-Rl&ln#QY})_l1$7E%#2dZlTs}$Q&P176HQGMr$6jq6rX;#lhJj0ZWp87^hX_xV$)+g7%doU0l0f_B>(^b delta 254 zcmX>xjcv_TwhiC+3Woci_Sjc=a^~SI1_lt8p6u8yHhq3OBgba7eQc7OjjzvSnr^GY z$i6w_7SmcjROQnv+8HC6UurN;cW7r6nf{`k(TGuNx^xGl2TQ*PBg6C!U5qjk0p6@^ z3_!pMgmak~7`$2;8P+pZD@}K7XA}n8q@!e|pp=|ukd|U#X>4JXXq=d6YGjaNX_#he zm~3HbZfRm+Xk-ZzNi;B;9^b_%KApdt(PDZ+7o*tp-cCl}>FYWer%b=q$rw02uZ@vw kdP5hZ_4K?hMvm!Dos7=Y-*+&wPmlHlN}TCp)Mcy%03JP3e*gdg diff --git a/src/calibre/ebooks/oeb/display/paged.coffee b/src/calibre/ebooks/oeb/display/paged.coffee index 909ac15ae9..d3a88183c5 100644 --- a/src/calibre/ebooks/oeb/display/paged.coffee +++ b/src/calibre/ebooks/oeb/display/paged.coffee @@ -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
. 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() diff --git a/src/pyj/read_book/paged_mode.pyj b/src/pyj/read_book/paged_mode.pyj index cc193d6530..50ba10bcc9 100644 --- a/src/pyj/read_book/paged_mode.pyj +++ b/src/pyj/read_book/paged_mode.pyj @@ -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
. 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()