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)

This commit is contained in:
Kovid Goyal 2016-08-11 19:56:34 +05:30
parent df1d52a7ef
commit 202528eda9

View File

@ -921,6 +921,9 @@ class DocumentView(QWebView): # {{{
def load_path(self, path, pos=0.0): def load_path(self, path, pos=0.0):
self.initial_pos = pos self.initial_pos = pos
self.last_loaded_path = path 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): def callback(lu):
self.loading_url = lu self.loading_url = lu