Explorar el Código

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

Book Pauk hace 6 años
padre
commit
2a354b1c08

+ 1 - 1
client/components/Reader/TextPage/TextPage.vue

@@ -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,

+ 2 - 2
client/components/Reader/share/BookParser.js

@@ -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;