mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -04:00
...
This commit is contained in:
parent
507620e12d
commit
ceb0638ccd
@ -626,8 +626,16 @@ class CanonicalFragmentIdentifier
|
|||||||
return cfi
|
return cfi
|
||||||
cury += delta
|
cury += delta
|
||||||
|
|
||||||
# TODO: Return the CFI corresponding to the <body> tag
|
# Use a spatial offset on the html element, since we could not find a
|
||||||
null
|
# normal CFI
|
||||||
|
[x, y] = window_scroll_pos()
|
||||||
|
de = document.documentElement
|
||||||
|
rect = de.getBoundingClientRect()
|
||||||
|
px = (x*100)/rect.width
|
||||||
|
py = (y*100)/rect.height
|
||||||
|
cfi = "/2@#{ fstr px }:#{ fstr py }"
|
||||||
|
|
||||||
|
return cfi
|
||||||
|
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user