Поправки багов

This commit is contained in:
Book Pauk
2019-01-16 02:59:49 +07:00
parent b45d4e1156
commit 2a354b1c08
2 changed files with 3 additions and 3 deletions

View File

@@ -93,7 +93,7 @@ class TextPage extends Vue {
let newItems = []; let newItems = [];
for (const line of lines) { for (const line of lines) {
console.log(line); //console.log(line);
/* line: /* line:
{ {
begin: Number, begin: Number,

View File

@@ -204,7 +204,7 @@ export default class BookParser {
let last = this.para.length - 1; let last = this.para.length - 1;
while (first < last) { while (first < last) {
let mid = first + Math.floor((last - first)/2); 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; last = mid;
else else
first = mid + 1; first = mid + 1;
@@ -296,7 +296,7 @@ export default class BookParser {
let last = lines.length - 1; let last = lines.length - 1;
while (first < last) { while (first < last) {
let mid = first + Math.floor((last - first)/2); let mid = first + Math.floor((last - first)/2);
if (bookPos <= lines[mid].begin) if (bookPos <= lines[mid].end)
last = mid; last = mid;
else else
first = mid + 1; first = mid + 1;