mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Workaround for error in scroll_to() on some japanese books with vertical text
This commit is contained in:
parent
2dd562b731
commit
043f9a5b88
@ -540,7 +540,11 @@ def scroll_to(cfi, callback, doc): # {{{
|
|||||||
|
|
||||||
# Reset the range to what it was before the span was added
|
# Reset the range to what it was before the span was added
|
||||||
r.setStart(sc, so)
|
r.setStart(sc, so)
|
||||||
r.setEnd(ec, eo)
|
try:
|
||||||
|
r.setEnd(ec, eo)
|
||||||
|
except:
|
||||||
|
# this happens for some japanese books
|
||||||
|
r.setEnd(ec, eo-1)
|
||||||
rects = r.getClientRects()
|
rects = r.getClientRects()
|
||||||
if rects.length > 0:
|
if rects.length > 0:
|
||||||
rect = rects[0]
|
rect = rects[0]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user