mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
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)
This commit is contained in:
parent
1053533932
commit
9b2ebcfdc5
Binary file not shown.
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user