Move section marks calculation to view

Also try to fix section mark epsilon
This commit is contained in:
John Factotum committed 2023-11-02 16:10:40 +08:00
1 parent 7dcbc6921a
commit 2a6012d749
3 files changed
+26 -27

No files matched your search

+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)