From 5931b9625bd2db72ab1f3f17e18b9aec6600ccd3 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Thu, 7 Mar 2019 20:12:38 +0700 Subject: [PATCH 1/2] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B8=D0=BB?= =?UTF-8?q?=20=D0=BC=D0=B5=D1=85=D0=B0=D0=BD=D0=B8=D0=B7=D0=BC=D1=8B=20ove?= =?UTF-8?q?rflow=20=D0=BF=D1=80=D0=B8=20=D0=BE=D1=82=D1=80=D0=B8=D1=81?= =?UTF-8?q?=D0=BE=D0=B2=D0=BA=D0=B5=20=D1=81=D1=82=D1=80=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D1=86=D1=8B=20-=20=D1=82=D0=B5=D0=BF=D0=B5=D1=80=D1=8C=20?= =?UTF-8?q?=D0=BD=D0=B5=20"=D1=81=D1=8A=D0=B5=D0=B4=D0=B0=D0=B5=D1=82"=20?= =?UTF-8?q?=D1=87=D0=B0=D1=81=D1=82=D1=8C=20=D1=88=D1=80=D0=B8=D1=84=D1=82?= =?UTF-8?q?=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/Reader/TextPage/DrawHelper.js | 2 +- .../components/Reader/TextPage/TextPage.vue | 47 +++++++++++++------ 2 files changed, 34 insertions(+), 15 deletions(-) diff --git a/client/components/Reader/TextPage/DrawHelper.js b/client/components/Reader/TextPage/DrawHelper.js index ec6406ea..da5e23b1 100644 --- a/client/components/Reader/TextPage/DrawHelper.js +++ b/client/components/Reader/TextPage/DrawHelper.js @@ -28,7 +28,7 @@ export default class DrawHelper { let out = `
`; + ` line-height: ${this.lineHeight}px; white-space: nowrap;">`; let imageDrawn = new Set(); let len = lines.length; diff --git a/client/components/Reader/TextPage/TextPage.vue b/client/components/Reader/TextPage/TextPage.vue index 7247da13..20bc986d 100644 --- a/client/components/Reader/TextPage/TextPage.vue +++ b/client/components/Reader/TextPage/TextPage.vue @@ -4,13 +4,13 @@
-
-
+
+
-
-
+
+
@@ -157,9 +157,11 @@ class TextPage extends Vue { this.$refs.layoutEvents.style.height = this.realHeight + 'px'; this.w = this.realWidth - 2*this.indentLR; - this.h = this.realHeight - (this.showStatusBar ? this.statusBarHeight : 0) - 2*this.indentTB; + this.scrollHeight = this.realHeight - (this.showStatusBar ? this.statusBarHeight : 0); + this.h = this.scrollHeight - 2*this.indentTB; this.lineHeight = this.fontSize + this.lineInterval; - this.pageLineCount = 1 + Math.floor((this.h - this.fontSize)/this.lineHeight); + this.pageLineCount = 1 + Math.floor((this.h - this.lineHeight + this.lineInterval/2)/this.lineHeight); + this.pageSpace = this.scrollHeight - this.pageLineCount*this.lineHeight; this.$refs.scrollingPage1.style.width = this.w + 'px'; this.$refs.scrollingPage2.style.width = this.w + 'px'; @@ -193,6 +195,7 @@ class TextPage extends Vue { this.drawHelper.indentLR = this.indentLR; this.drawHelper.textAlignJustify = this.textAlignJustify; this.drawHelper.lineHeight = this.lineHeight; + this.drawHelper.pageSpace = this.pageSpace; this.drawHelper.context = this.context; //сообщение "Загрузка шрифтов..." @@ -232,20 +235,26 @@ class TextPage extends Vue { this.statusBarClickable = this.drawHelper.statusBarClickable(this.statusBarTop, this.statusBarHeight); //scrolling page - const pageDelta = this.h - (this.pageLineCount*this.lineHeight - this.lineInterval); - let y = this.indentTB + pageDelta/2; + let y = this.pageSpace/2; if (this.showStatusBar) y += this.statusBarHeight*(this.statusBarTop ? 1 : 0); - const page1 = this.$refs.scrollBox1; - const page2 = this.$refs.scrollBox2; - page1.style.width = this.w + 'px'; - page2.style.width = this.w + 'px'; - page1.style.height = (this.h - pageDelta) + 'px'; - page2.style.height = (this.h - pageDelta) + 'px'; + let page1 = this.$refs.scrollBox1; + let page2 = this.$refs.scrollBox2; + page1.style.width = this.w + this.indentLR + 'px'; + page2.style.width = this.w + this.indentLR + 'px'; + page1.style.height = this.scrollHeight - (this.pageSpace > 0 ? this.pageSpace : 0) + 'px'; + page2.style.height = this.scrollHeight - (this.pageSpace > 0 ? this.pageSpace : 0) + 'px'; page1.style.top = y + 'px'; page2.style.top = y + 'px'; page1.style.left = this.indentLR + 'px'; page2.style.left = this.indentLR + 'px'; + + page1 = this.$refs.scrollingPage1; + page2 = this.$refs.scrollingPage2; + page1.style.width = this.w + this.indentLR + 'px'; + page2.style.width = this.w + this.indentLR + 'px'; + page1.style.height = this.scrollHeight + this.lineHeight + 'px'; + page2.style.height = this.scrollHeight + this.lineHeight + 'px'; } async checkLoadedFonts() { @@ -633,8 +642,14 @@ class TextPage extends Vue { duration, this.pageChangeDirectionDown, transition1Finish); break; case 'downShift': + page1.style.height = this.scrollHeight + 'px'; + page2.style.height = this.scrollHeight + 'px'; + await this.drawHelper.doPageAnimationDownShift(page1, page2, duration, this.pageChangeDirectionDown, transition1Finish); + + page1.style.height = this.scrollHeight + this.lineHeight + 'px'; + page2.style.height = this.scrollHeight + this.lineHeight + 'px'; break; } @@ -1098,6 +1113,10 @@ class TextPage extends Vue { z-index: 10; } +.over-hidden { + overflow: hidden; +} + .back { z-index: 5; } From d307d233f032068bdcbbc67b7294a6c5470cd2aa Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Thu, 7 Mar 2019 20:16:20 +0700 Subject: [PATCH 2/2] =?UTF-8?q?=D0=92=D0=B5=D1=80=D1=81=D0=B8=D1=8F=200.5.?= =?UTF-8?q?6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7b58717c..71b5ffcc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "Liberama", - "version": "0.5.5", + "version": "0.5.6", "engines": { "node": ">=10.0.0" },