浏览代码

К предыдущему

Book Pauk 6 年之前
父节点
当前提交
2b755e534e
共有 1 个文件被更改,包括 10 次插入6 次删除
  1. 10 6
      client/components/Reader/TextPage/TextPage.vue

+ 10 - 6
client/components/Reader/TextPage/TextPage.vue

@@ -227,23 +227,25 @@ class TextPage extends Vue {
 
         this.activeCanvas = !this.activeCanvas;
 
-        immediate = true;
         if (immediate) {            
             if (this.activeCanvas)
                 this.page1 = this.drawPage(this.bookPos);
             else
                 this.page2 = this.drawPage(this.bookPos);
         } else {
-            /*if (this.pageChangeDirectionDown && this.pagePrepared && this.bookPos == this.bookPosPrepared) {
+            if (this.pageChangeDirectionDown && this.pagePrepared && this.bookPos == this.bookPosPrepared) {
                 this.linesDown = this.linesDownNext;
                 this.linesUp = this.linesUpNext;
                 this.pagePrepared = false;
                 this.debouncedPrepareNextPage();
             } else {
-                this.drawPage(context, this.bookPos);
+                if (this.activeCanvas)
+                    this.page1 = this.drawPage(this.bookPos);
+                else
+                    this.page2 = this.drawPage(this.bookPos);
                 this.pagePrepared = false;
                 this.debouncedPrepareNextPage();
-            }*/
+            }
 
             if (this.currentTransition) {
                 //this.currentTransition
@@ -408,8 +410,10 @@ class TextPage extends Vue {
                 if (i >= 0 && this.linesDown.length > i) {
                     this.bookPosPrepared = this.linesDown[i].begin;
 
-                    const ctx = (!this.activeCanvas ? this.context1 : this.context2);
-                    this.drawPage(ctx, this.bookPosPrepared, true);
+                    if (this.activeCanvas)
+                        this.page2 = this.drawPage(this.bookPosPrepared, true);//наоборот
+                    else
+                        this.page1 = this.drawPage(this.bookPosPrepared, true);
   
                     this.pagePrepared = true;
                 }