Browse Source

Поправки

Book Pauk 6 years ago
parent
commit
0043b862ad
1 changed files with 9 additions and 8 deletions
  1. 9 8
      client/components/Reader/TextPage/TextPage.vue

+ 9 - 8
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();