From 096b60166aa7558c44d79ca973cbab1c3f987f03 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Sat, 2 Feb 2019 20:04:32 +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 | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/client/components/Reader/TextPage/TextPage.vue b/client/components/Reader/TextPage/TextPage.vue index b144b8d5..6536d03f 100644 --- a/client/components/Reader/TextPage/TextPage.vue +++ b/client/components/Reader/TextPage/TextPage.vue @@ -634,12 +634,14 @@ class TextPage extends Vue { for (let j = 0; j < partWords.length; j++) { let f = font; + let style = part.style; let word = partWords[j]; if (i == 0 && this.searching && word.toLowerCase().indexOf(this.needle) >= 0) { - f = this.fontByStyle(Object.assign({}, part.style, {bold: true})); + style = Object.assign({}, part.style, {bold: true}); + f = this.fontByStyle(style); } out += this.drawHelper.fillText(word, x, y, f); - x += this.measureText(word, part.style) + (j < partWords.length - 1 ? space : 0); + x += this.measureText(word, style) + (j < partWords.length - 1 ? space : 0); } } filled = true; @@ -657,12 +659,14 @@ class TextPage extends Vue { let partWords = part.text.split(' '); for (let j = 0; j < partWords.length; j++) { let f = font; + let style = part.style; let word = partWords[j]; if (word.toLowerCase().indexOf(this.needle) >= 0) { - f = this.fontByStyle(Object.assign({}, part.style, {bold: true})); + style = Object.assign({}, part.style, {bold: true}); + f = this.fontByStyle(style); } out += this.drawHelper.fillText(word, x, y, f); - x += this.measureText(word, part.style) + (j < partWords.length - 1 ? spaceWidth : 0); + x += this.measureText(word, style) + (j < partWords.length - 1 ? spaceWidth : 0); } } else { out += this.drawHelper.fillText(part.text, x, y, font);