From 9b2ebcfdc5212d05be0ff0cf46e0d6afc54fba4e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 21 Sep 2014 21:02:13 +0530 Subject: [PATCH] E-book viewer: Fix displaying multiple pages per screen not working in calibre 2.x with some books, due to a change in Qt 5. Fixes #1372066 [Private bug](https://bugs.launchpad.net/calibre/+bug/1372066) --- resources/compiled_coffeescript.zip | Bin 93320 -> 93546 bytes src/calibre/ebooks/oeb/display/paged.coffee | 14 +++++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/resources/compiled_coffeescript.zip b/resources/compiled_coffeescript.zip index 615531f2330473a52a0dd69ac5789c5a5433c38d..5e9f6ae63bb26f9021fc6596b33e0ddb19d87ecf 100644 GIT binary patch delta 361 zcmeCU$@=OR>xMlu_}EvNy83M>xcDZ8f#FTcWZu7$)9tbtIX1tZ@kfj`FF8M_c=OZs z=ULc{6tonIb0_QXQkXn{3;*QTTU-RybrjSM3Mv#b^NLeT6q0gECmZgO2Fh}5PS`q~ zhXtg0^1)o;=?7RDSts}1Vq?^w+;CAsB{NMy18lH@qOGlhZ(>P?URq9mei1}aQ$bBl zL2+{KbG6CtI|U@lGgC@3fEJ-En{0Sbc(TDIb|#>kK4ge({&P@h883=orb}lqMloIg zJ6Z6r?DQ!aj9N@b`KKSqV035Fk_6Er(`7Rm&6zf8K{)?48M&sHWHJh{=cF?-{9~$~ zzA&3nWb%Ph?&+&C85d|6nWmbVn>xMlu_&)4Zb5-bg`G_lpfq^S!^83G%(-pEAIX1tZ@kea)yY**TI5dnD zv=oYSH76h3QY@gGoS&0lq^_fomJVi37T6=XIbrL3p3OH8i7(?tF>U(a48|y?uYaZs zWHO3Q&&y;qVtLHR$T0mwHly_P{h5qfOdb-`UuQCUvz*ri3SZ1&l$jou#VEkhmBz^M zkEvQ|`onZa;mHR|xu^GJF)q+BG)*;0HZ(ReHc2!wGEYmguuM)#GBh(WF||lDNJ}#^ bH8L?ZOEgHDzA&3nd~$9g*Y?tE#;=S3j}BJ4 diff --git a/src/calibre/ebooks/oeb/display/paged.coffee b/src/calibre/ebooks/oeb/display/paged.coffee index 6a922ac043..7de9817d03 100644 --- a/src/calibre/ebooks/oeb/display/paged.coffee +++ b/src/calibre/ebooks/oeb/display/paged.coffee @@ -152,9 +152,9 @@ class PagedDisplay fgcolor = body_style.getPropertyValue('color') - bs.setProperty('-webkit-column-gap', (2*sm)+'px') - bs.setProperty('-webkit-column-width', col_width+'px') - bs.setProperty('-webkit-column-rule-color', fgcolor) + bs.setProperty('-webkit-column-gap', 2*sm + 'px') + bs.setProperty('-webkit-column-width', col_width + 'px') + bs.setProperty('-webkit-column-rule', '0px inset blue') # Without this, webkit bleeds the margin of the first block(s) of body # above the columns, which causes them to effectively be added to the @@ -231,6 +231,14 @@ class PagedDisplay if is_single_page this.is_full_screen_layout = true + ncols = document.body.scrollWidth / this.page_width + if ncols != Math.floor(ncols) and not this.is_full_screen_layout + # In Qt 5 WebKit will sometimes adjust the individual column widths for + # better text layout. This is allowed as per the CSS spec, so the + # only way to ensure fixed column widths is to make sure the body + # width is an exact multiple of the column widths + bs.setProperty('width', Math.floor(ncols) * this.page_width - 2 * sm) + this.in_paged_mode = true this.current_margin_side = sm # log('Time to layout:', new Date().getTime() - start_time)