diff --git a/src/pyj/read_book/cfi.pyj b/src/pyj/read_book/cfi.pyj index d913e78f5f..3d5b62a17d 100644 --- a/src/pyj/read_book/cfi.pyj +++ b/src/pyj/read_book/cfi.pyj @@ -540,7 +540,11 @@ def scroll_to(cfi, callback, doc): # {{{ # Reset the range to what it was before the span was added 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() if rects.length > 0: rect = rects[0]