From ce4f774114d43e47e241bbd9271f4cbf127f936e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 27 Jun 2017 15:28:33 +0530 Subject: [PATCH] Viewer: Fix incorrect display of pages in paged mode for books that override the default box-sizing CSS property on the element. Fixes #1700109 [css margin-left and margin-right problem](https://bugs.launchpad.net/calibre/+bug/1700109) --- resources/compiled_coffeescript.zip | Bin 102025 -> 102076 bytes src/calibre/ebooks/oeb/display/paged.coffee | 1 + src/pyj/read_book/paged_mode.pyj | 2 +- 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/compiled_coffeescript.zip b/resources/compiled_coffeescript.zip index e6f5ad224229d60b1875ba74611e887c6c781345..846f8d323b894a4f3ef41b51934660dd83b16253 100644 GIT binary patch delta 258 zcmeC2%eH4O+lEW~c=uG@_DU-XH(s8{z_5Jt{e9g^5=r?Ly2Y7QnR)5zItuE^`FSO& zc_q3@`I7~oOHc1*WaQsm`Os)3s?O;Y+U?|yqe_yxK=D80YSE7nff8E6x#ayb(IQhX; zk?Aqrj7E&xruTO6`sDghml9a z(8AC>)zaM3Aki|>+%z@Oz$hg(&A`&a)W|f+)Y8nzFv;8?B{jujdVU|H&-70{jER$F z*KkeO>0xx9T+q!o{d+H?_4K+vMvlq3iCoi{^)fn7&+lRMn;zWD=s2yHksV^Wb04EF GV=Vy0l1*^{ diff --git a/src/calibre/ebooks/oeb/display/paged.coffee b/src/calibre/ebooks/oeb/display/paged.coffee index e53b94236d..8b0f1e0ad4 100644 --- a/src/calibre/ebooks/oeb/display/paged.coffee +++ b/src/calibre/ebooks/oeb/display/paged.coffee @@ -192,6 +192,7 @@ class PagedDisplay fgcolor = body_style.getPropertyValue('color') + bs.setProperty('box-sizing', 'content-box') bs.setProperty('-webkit-column-gap', 2*sm + 'px') bs.setProperty('-webkit-column-width', col_width + 'px') bs.setProperty('-webkit-column-rule', '0px inset blue') diff --git a/src/pyj/read_book/paged_mode.pyj b/src/pyj/read_book/paged_mode.pyj index 949adaac17..2e9486b14b 100644 --- a/src/pyj/read_book/paged_mode.pyj +++ b/src/pyj/read_book/paged_mode.pyj @@ -170,7 +170,7 @@ def layout(is_single_page): set_css(document.body, column_gap=gap + 'px', column_width=col_width + 'px', column_rule='0px inset blue', min_width='0', max_width='none', min_height='0', max_height='100vh', column_fill='auto', - margin='0', border_width='0', padding='0', + margin='0', border_width='0', padding='0', box_sizing='content-box', width=screen_width + 'px', height=screen_height + 'px' ) # Without this, webkit bleeds the margin of the first block(s) of body