From 202528eda965cc2105349c0583775af33353bfc8 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 11 Aug 2016 19:56:34 +0530 Subject: [PATCH] E-book viewer: Fix books that set side margins on body using percentages not working correctly. Fixes #1608458 [Private bug](https://bugs.launchpad.net/calibre/+bug/1608458) --- src/calibre/gui2/viewer/documentview.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/calibre/gui2/viewer/documentview.py b/src/calibre/gui2/viewer/documentview.py index 6566faecbc..415211162e 100644 --- a/src/calibre/gui2/viewer/documentview.py +++ b/src/calibre/gui2/viewer/documentview.py @@ -921,6 +921,9 @@ class DocumentView(QWebView): # {{{ def load_path(self, path, pos=0.0): self.initial_pos = pos self.last_loaded_path = path + # This is needed otherwise percentage margins on body are not correctly + # evaluated in read_document_margins() in paged mode. + self.document.setPreferredContentsSize(QSize()) def callback(lu): self.loading_url = lu