Fix points at the right edge of the column being identified as belonging to the next column in paged mode

This commit is contained in:
Kovid Goyal 2020-08-13 18:09:55 +05:30
parent 603b9b70ff
commit 6141113d5b
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -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