From 97422c31b6c5de068221f30222ba11f9f2a7e6db Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Mon, 21 Jan 2019 00:21:51 +0700 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D0=BE=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20?= =?UTF-8?q?=D0=B2=D1=80=D0=B5=D0=BC=D0=B5=D0=BD=D0=B8=20=D0=B2=20=D1=81?= =?UTF-8?q?=D1=82=D0=B0=D1=82=D1=83=D1=81=20=D0=B1=D0=B0=D1=80=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/Reader/TextPage/TextPage.vue | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/client/components/Reader/TextPage/TextPage.vue b/client/components/Reader/TextPage/TextPage.vue index 67f084e6..3fde6574 100644 --- a/client/components/Reader/TextPage/TextPage.vue +++ b/client/components/Reader/TextPage/TextPage.vue @@ -166,7 +166,7 @@ class TextPage extends Vue { this.statusBarTop = false;// top, bottom this.statusBarHeight = 20;// px - this.pageChangeTransition = '';// '' - нет, upDown, leftRight, thawing - протаивание, blink - мерцание + this.pageChangeTransition = '';// '' - нет, downShift, rightShift, thaw - протаивание, blink - мерцание this.pageChangeTransitionSpeed = 50; //0-100% this.calcDrawProps(); @@ -199,6 +199,7 @@ class TextPage extends Vue { await this.loadFonts(); this.draw(); + this.refreshTime(); })(); } } @@ -267,14 +268,7 @@ class TextPage extends Vue { if (this.showStatusBar) this.drawHelper.drawStatusBar(context, this.statusBarTop, this.statusBarHeight, this.statusBarColor, bookPos, this.parsed.textLength, this.title); -/* - if (!this.timeRefreshing) { - this.timeRefreshing = true; - await sleep(60*1000); - this.timeRefreshing = false; - this.drawStatusBar(); - } -*/ + context.font = this.font; context.fillStyle = this.textColor; const spaceWidth = context.measureText(' ').width; @@ -353,6 +347,20 @@ class TextPage extends Vue { } } + async refreshTime() { + if (!this.timeRefreshing) { + this.timeRefreshing = true; + await sleep(60*1000); + + if (this.book && this.parsed.textLength) { + this.drawHelper.drawStatusBar(this.context, this.statusBarTop, this.statusBarHeight, + this.statusBarColor, this.bookPos, this.parsed.textLength, this.title); + } + this.timeRefreshing = false; + this.refreshTime(); + } + } + prepareNextPage() { // подготовка следующей страницы заранее this.pagePrepared = false; @@ -385,7 +393,7 @@ class TextPage extends Vue { } else { this.cancelPrepare = true; } - } + } doDown() { if (this.linesDown && this.linesDown.length > 1) {