From 4764259b78d5a713678161bb59a0896aca37f87e Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Sat, 19 Jan 2019 06:31:28 +0700 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B4=D0=B5=D0=BB=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/Reader/TextPage/TextPage.vue | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/client/components/Reader/TextPage/TextPage.vue b/client/components/Reader/TextPage/TextPage.vue index d7fe3c0c..a78c6b2e 100644 --- a/client/components/Reader/TextPage/TextPage.vue +++ b/client/components/Reader/TextPage/TextPage.vue @@ -233,13 +233,17 @@ class TextPage extends Vue { return; const context = this.context; - context.font = 'bold ' + this.fontBySize(this.statusBarHeight - 6); - context.fillStyle = this.statusBarColor; - context.strokeStyle = this.statusBarColor; const h = (this.statusBarTop ? 1 : this.realHeight - this.statusBarHeight); const lh = (this.statusBarTop ? this.statusBarHeight : h); + context.fillStyle = this.backgroundColor; + context.fillRect(0, h, this.realWidth, lh); + + context.font = 'bold ' + this.fontBySize(this.statusBarHeight - 6); + context.fillStyle = this.statusBarColor; + context.strokeStyle = this.statusBarColor; + context.fillRect(0, lh, this.realWidth, 1); const date = new Date(); @@ -252,20 +256,22 @@ class TextPage extends Vue { this.drawPercentBar(this.realWidth/2, h, this.realWidth/2 - timeW, this.statusBarHeight); - await sleep(60*1000); - this.drawStatusBar(); + if (!this.timeRefreshing) { + this.timeRefreshing = true; + await sleep(60*1000); + this.timeRefreshing = false; + this.drawStatusBar(); + } } drawPage() { if (!this.lastBook) return; - //пустой канвас - const canvas = this.canvas; const context = this.context; context.fillStyle = this.backgroundColor; - context.fillRect(0, 0, canvas.width, canvas.height); + context.fillRect(0, 0, this.realWidth, this.realHeight); if (!this.book || !this.parsed.textLength) return;