E-book viewer: Fix placement of selection handles in some books when modifying an existing highlight

This commit is contained in:
Kovid Goyal 2025-09-15 10:14:55 +05:30
parent 8db3e0f996
commit 81475dad84
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -124,11 +124,11 @@ def range_extents(q, in_flow_mode):
if boundary_node:
if boundary_node.nodeType is Node.TEXT_NODE:
if is_start:
r.setStart(boundary_node, boundary_node.length - 1)
r.setEnd(boundary_node, boundary_node.length)
else:
r.setStart(boundary_node, 0)
r.setEnd(boundary_node, 1)
r.setEnd(boundary_node, 0)
else:
r.setStart(boundary_node, boundary_node.length)
r.setEnd(boundary_node, boundary_node.length)
rect = r.getBoundingClientRect()
else:
rect = boundary_node.getBoundingClientRect()