E-book viewer: Fix right or shift-clicking to extend selection not shrinking selection when the click is inside the selection. Fixes #1926793 [E-book viewer: right-clicking inside the selection does nothing](https://bugs.launchpad.net/calibre/+bug/1926793)

This commit is contained in:
Kovid Goyal 2021-05-09 12:28:45 +05:30
parent 333f42945a
commit 1095dc4dc6
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -206,7 +206,8 @@ def move_end_of_selection(pos, start):
elif r.compareBoundaryPoints(window.Range.END_TO_END, q) <= 0: elif r.compareBoundaryPoints(window.Range.END_TO_END, q) <= 0:
start = False start = False
else: else:
return # point is inside the selection
start = False
if start: if start:
if r.startContainer is not p.offsetNode or r.startOffset is not p.offset: if r.startContainer is not p.offsetNode or r.startOffset is not p.offset:
r.setStart(p.offsetNode, p.offset) r.setStart(p.offsetNode, p.offset)