From 2d074400e289af7e571674d3acc586182440f7c1 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 12 Oct 2021 08:18:43 +0530 Subject: [PATCH] E-book viewer: Fix cover and full screen images not centered in paged mode when more than one page is displayed per screen. --- src/pyj/read_book/paged_mode.pyj | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/pyj/read_book/paged_mode.pyj b/src/pyj/read_book/paged_mode.pyj index 81908aa228..3a3772292c 100644 --- a/src/pyj/read_book/paged_mode.pyj +++ b/src/pyj/read_book/paged_mode.pyj @@ -329,6 +329,12 @@ def layout(is_single_page, on_resize): is_full_screen_layout = True if has_svg and svgs.length == 1 and svgs[0].getBoundingClientRect().left < wi: is_full_screen_layout = True + if is_full_screen_layout and only_img and cols_per_screen > 1: + cols_per_screen = 1 + col_size = screen_inline + col_and_gap = col_size + gap + number_of_cols = 1 + document.body.style.columnWidth = f'100vw' # Some browser engine, WebKit at least, adjust column sizes to please # themselves, unless the container size is an exact multiple, so we check