diff --git a/client/components/Reader/TextPage/TextPage.vue b/client/components/Reader/TextPage/TextPage.vue index c16cf80a..14795dd6 100644 --- a/client/components/Reader/TextPage/TextPage.vue +++ b/client/components/Reader/TextPage/TextPage.vue @@ -93,7 +93,7 @@ class TextPage extends Vue { let newItems = []; for (const line of lines) { -console.log(line); +//console.log(line); /* line: { begin: Number, diff --git a/client/components/Reader/share/BookParser.js b/client/components/Reader/share/BookParser.js index 4b35ad67..c9ecfc2b 100644 --- a/client/components/Reader/share/BookParser.js +++ b/client/components/Reader/share/BookParser.js @@ -204,7 +204,7 @@ export default class BookParser { let last = this.para.length - 1; while (first < last) { let mid = first + Math.floor((last - first)/2); - if (bookPos <= this.para[mid].offset) + if (bookPos <= this.para[mid].offset + this.para[mid].length - 1) last = mid; else first = mid + 1; @@ -296,7 +296,7 @@ export default class BookParser { let last = lines.length - 1; while (first < last) { let mid = first + Math.floor((last - first)/2); - if (bookPos <= lines[mid].begin) + if (bookPos <= lines[mid].end) last = mid; else first = mid + 1;