aboutsummaryrefslogtreecommitdiffstats
path: root/epy.py
diff options
context:
space:
mode:
authorbenadha <benawiadha@gmail.com>2021-02-02 17:37:20 +0700
committerbenadha <benawiadha@gmail.com>2021-02-02 17:37:20 +0700
commitb573a9b8defe30e7291b7f39ec372c5d2a15e947 (patch)
treed00ccd580a0ab4c38bdb9b7ba479cf1b21e37351 /epy.py
parenta15cb8e89b8f7c7a868748a75161366776a2a0ca (diff)
downloadepy-b573a9b8defe30e7291b7f39ec372c5d2a15e947.tar.gz
Better PageUp to prev index for doublespread
Diffstat (limited to 'epy.py')
-rwxr-xr-xepy.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/epy.py b/epy.py
index 494750c..0b96c4d 100755
--- a/epy.py
+++ b/epy.py
@@ -1715,7 +1715,10 @@ def reader(ebook, index, width, y, pctg, sect):
elif k in K["PageUp"]:
if y == 0 and index != 0:
ANIMATE = "prev"
- return -1, width, -(rows*SPREAD), None, ""
+ tmp_parser = HTMLtoLines()
+ tmp_parser.feed(ebook.get_raw_text(contents[index-1]))
+ tmp_parser.close()
+ return -1, width, rows*SPREAD*(len(tmp_parser.get_lines(width)[0])//(rows*SPREAD)), None, ""
else:
if y >= rows*SPREAD*count:
ANIMATE = "prev"