mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
E-book viewer: Fix selection popup not showing for some books on some platforms when the selection is in the top line. Fixes #2024375 [Private bug](https://bugs.launchpad.net/calibre/+bug/2024375)
This commit is contained in:
parent
fd3a42cee8
commit
e7f8ee5cd6
@ -95,7 +95,10 @@ def range_extents(q, in_flow_mode):
|
|||||||
end = q.cloneRange()
|
end = q.cloneRange()
|
||||||
|
|
||||||
def rect_onscreen(r):
|
def rect_onscreen(r):
|
||||||
if r.right <= window.innerWidth and r.bottom <= window.innerHeight and r.left >= 0 and r.top >= 0:
|
# we use -1 rather than zero for the top limit because on some
|
||||||
|
# platforms the browser engine returns that for top line selections.
|
||||||
|
# See https://bugs.launchpad.net/calibre/+bug/2024375/ for a test case.
|
||||||
|
if r.right <= window.innerWidth and r.bottom <= window.innerHeight and r.left >= 0 and r.top >= -1:
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user