mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1924872 [Shift select with no current selection results in error](https://bugs.launchpad.net/calibre/+bug/1924872)
This commit is contained in:
parent
f03f2c06a4
commit
6ec52ff451
@ -628,7 +628,10 @@ def ensure_selection_visible():
|
|||||||
|
|
||||||
def ensure_selection_boundary_visible(use_end):
|
def ensure_selection_boundary_visible(use_end):
|
||||||
sel = window.getSelection()
|
sel = window.getSelection()
|
||||||
|
try:
|
||||||
rr = sel.getRangeAt(0)
|
rr = sel.getRangeAt(0)
|
||||||
|
except:
|
||||||
|
rr = None
|
||||||
if rr:
|
if rr:
|
||||||
r = rr.getBoundingClientRect()
|
r = rr.getBoundingClientRect()
|
||||||
if r:
|
if r:
|
||||||
|
@ -569,7 +569,10 @@ def snap_to_selection():
|
|||||||
|
|
||||||
def ensure_selection_boundary_visible(use_end):
|
def ensure_selection_boundary_visible(use_end):
|
||||||
sel = window.getSelection()
|
sel = window.getSelection()
|
||||||
|
try:
|
||||||
rr = sel.getRangeAt(0)
|
rr = sel.getRangeAt(0)
|
||||||
|
except:
|
||||||
|
rr = None
|
||||||
if rr:
|
if rr:
|
||||||
r = rr.getBoundingClientRect()
|
r = rr.getBoundingClientRect()
|
||||||
if r:
|
if r:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user