Поправки багов
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user