E-book viewer: In paged mode, fix scrolling not working correctly when margins are set to zero. Fixes #1918105 [back keyboard shortcut not working [solved]](https://bugs.launchpad.net/calibre/+bug/1918105)

This commit is contained in:
Kovid Goyal 2021-03-10 22:54:10 +05:30
parent f38ac80991
commit 2ad7fdc33f
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -282,6 +282,8 @@ def layout(is_single_page, on_resize):
# the window inline dimension, with their separator margins
wi = col_size = screen_inline = scroll_viewport.inline_size()
margin_size = (opts.margin_left + opts.margin_right) if scroll_viewport.horizontal_writing_mode else (opts.margin_top + opts.margin_bottom)
# a zero margin causes scrolling issues, see https://bugs.launchpad.net/calibre/+bug/1918437
margin_size = max(1, margin_size)
gap = margin_size
if n > 1:
# Adjust the margin so that the window inline dimension satisfies