From 2ad7fdc33ffb360d3ee0684821fd2362de9eb04f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 10 Mar 2021 22:54:10 +0530 Subject: [PATCH] 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) --- src/pyj/read_book/paged_mode.pyj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pyj/read_book/paged_mode.pyj b/src/pyj/read_book/paged_mode.pyj index 9d87088bbb..4cd35d220a 100644 --- a/src/pyj/read_book/paged_mode.pyj +++ b/src/pyj/read_book/paged_mode.pyj @@ -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