Fix CFI for fixed-layout books

This commit is contained in:
John Factotum
2023-04-26 17:27:51 +08:00
parent b1346280fd
commit 8a69caf1dd
+1 -1
View File
@@ -163,8 +163,8 @@ export class View {
this.emit?.({ type: 'show-annotation', value, range })
}
getCFI(index, range) {
if (!range) return ''
const baseCFI = this.book.sections[index].cfi ?? CFI.fake.fromIndex(index)
if (!range) return baseCFI
return CFI.joinIndir(baseCFI, CFI.fromRange(range))
}
resolveCFI(cfi) {