From 7bd159766bc229af222d7d3c4e985f927fa9cd48 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Fri, 18 Sep 2020 17:40:37 +0700 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B1=D0=B0=D0=B3=D0=B0=20=D0=B8?= =?UTF-8?q?=D1=81=D1=87=D0=B5=D0=B7=D0=BD=D0=BE=D0=B2=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F=20=D0=BA=D0=B0=D1=80=D1=82=D0=B8=D0=BD=D0=BE=D0=BA=20?= =?UTF-8?q?=D0=BF=D1=80=D0=B8=20=D0=B2=D0=BA=D0=BB=D1=8E=D1=87=D0=B5=D0=BD?= =?UTF-8?q?=D0=BD=D0=BE=D0=B9=20=D0=BD=D0=B0=D1=81=D1=82=D1=80=D0=BE=D0=B9?= =?UTF-8?q?=D0=BA=D0=B5=20"=D0=A3=D0=B1=D0=B8=D1=80=D0=B0=D1=82=D1=8C=20?= =?UTF-8?q?=D0=BF=D1=83=D1=81=D1=82=D1=8B=D0=B5=20=D1=81=D1=82=D1=80=D0=BE?= =?UTF-8?q?=D0=BA=D0=B8"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/components/Reader/share/BookParser.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/client/components/Reader/share/BookParser.js b/client/components/Reader/share/BookParser.js index 8412d9fd..5162c79f 100644 --- a/client/components/Reader/share/BookParser.js +++ b/client/components/Reader/share/BookParser.js @@ -656,6 +656,7 @@ export default class BookParser { let style = {}; let ofs = 0;//смещение от начала параграфа para.offset let imgW = 0; + let imageInPara = false; const compactWidth = this.measureText('W', {})*this.compactTextPerc/100; // тут начинается самый замес, перенос по слогам и стилизация, а также изображения for (const part of parts) { @@ -664,7 +665,7 @@ export default class BookParser { //изображения if (part.image.id && !part.image.inline) { - parsed.visible = this.showImages; + imageInPara = true; let bin = this.binary[part.image.id]; if (!bin) bin = {h: 1, w: 1}; @@ -832,10 +833,14 @@ export default class BookParser { } //parsed.visible - parsed.visible = !( - (para.addIndex > this.addEmptyParagraphs) || - (para.addIndex == 0 && this.cutEmptyParagraphs && paragraphText.trim() == '') - ); + if (imageInPara) { + parsed.visible = this.showImages; + } else { + parsed.visible = !( + (para.addIndex > this.addEmptyParagraphs) || + (para.addIndex == 0 && this.cutEmptyParagraphs && paragraphText.trim() == '') + ); + } parsed.lines = lines; para.parsed = parsed;