From 6141113d5b4e09628f1b5bea2904891a939afa48 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 13 Aug 2020 18:09:55 +0530 Subject: [PATCH] Fix points at the right edge of the column being identified as belonging to the next column in paged mode --- src/pyj/read_book/paged_mode.pyj | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pyj/read_book/paged_mode.pyj b/src/pyj/read_book/paged_mode.pyj index 0c554abb55..b970df5ca6 100644 --- a/src/pyj/read_book/paged_mode.pyj +++ b/src/pyj/read_book/paged_mode.pyj @@ -91,7 +91,9 @@ def column_at(pos): si = scroll_viewport.paged_content_inline_size() if pos >= si - col_and_gap: pos = si - col_size + 10 - return (pos + gap) // col_and_gap + # we subtract 1 here so that a point at the absolute trailing (right in + # horz-LTR) edge of a column remains in the column and not at the next column + return max(0, (pos + gap - 1)) // col_and_gap def fit_images(): # Ensure no images are wider than the available size of a column. Note