From 0043b862ad9cc9bdd21449344553048dcfbb10e2 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Fri, 18 Jan 2019 01:31:22 +0700 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D0=BA?= =?UTF-8?q?=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/components/Reader/TextPage/TextPage.vue | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/client/components/Reader/TextPage/TextPage.vue b/client/components/Reader/TextPage/TextPage.vue index 6cbdb6aa..bc7ff48b 100644 --- a/client/components/Reader/TextPage/TextPage.vue +++ b/client/components/Reader/TextPage/TextPage.vue @@ -50,19 +50,20 @@ class TextPage extends Vue { this.realWidth = this.$refs.main.clientWidth; this.realHeight = this.$refs.main.clientHeight; - if (window.devicePixelRatio) { - this.canvas.width = this.realWidth*window.devicePixelRatio; - this.canvas.height = this.realHeight*window.devicePixelRatio; + let ratio = window.devicePixelRatio; + if (ratio) { + this.canvas.width = this.realWidth*ratio; + this.canvas.height = this.realHeight*ratio; this.canvas.style.width = this.$refs.main.clientWidth + 'px'; this.canvas.style.height = this.$refs.main.clientHeight + 'px'; - this.context.scale(window.devicePixelRatio, window.devicePixelRatio); + this.context.scale(ratio, ratio); } else { this.canvas.width = this.realWidth; this.canvas.height = this.realHeight; } this.lineHeight = this.fontSize + this.lineInterval; - this.pageLineCount = Math.floor(this.canvas.height/this.lineHeight); + this.pageLineCount = Math.floor(this.realHeight/this.lineHeight); this.w = this.realWidth - 2*this.indent; this.h = this.realHeight; @@ -110,12 +111,12 @@ class TextPage extends Vue { this.textColor = 'black'; this.backgroundColor = '#478355'; this.fontStyle = '';// 'bold','italic' - this.fontSize = 33;// px + this.fontSize = 34;// px this.fontName = 'Arial'; - this.lineInterval = 10;// px, межстрочный интервал + this.lineInterval = 7;// px, межстрочный интервал this.textAlignJustify = true;// выравнивание по ширине this.p = 50;// px, отступ параграфа - this.indent = 10;// px, отступ всего текста слева и справа + this.indent = 15;// px, отступ всего текста слева и справа this.wordWrap = true; this.calcDrawProps();