Move section marks calculation to view

Also try to fix section mark epsilon
This commit is contained in:
John Factotum
2023-11-02 16:10:40 +08:00
parent 7dcbc6921a
commit 2a6012d749
3 changed files with 26 additions and 27 deletions
+4
View File
@@ -327,6 +327,10 @@ export class View extends HTMLElement {
for (const { doc } of this.renderer.getContents())
doc.defaultView.getSelection().removeAllRanges()
}
getSectionFractions() {
return (this.#sectionProgress?.sectionFractions ?? [])
.map(x => x + Number.EPSILON)
}
getProgressOf(index, range) {
const tocItem = this.#tocProgress?.getProgress(index, range)
const pageItem = this.#pageProgress?.getProgress(index, range)