From d6151d541e8e917ee94169d36185f0750a14b7ce Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Sun, 24 Feb 2019 21:27:18 +0700 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=B1=D0=B0=D0=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/components/Reader/share/BookParser.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/client/components/Reader/share/BookParser.js b/client/components/Reader/share/BookParser.js index 3a081d33..3358aaaa 100644 --- a/client/components/Reader/share/BookParser.js +++ b/client/components/Reader/share/BookParser.js @@ -669,13 +669,16 @@ export default class BookParser { let lineCount = this.imageHeightLines; let c = Math.ceil(bin.h/this.lineHeight); + + const maxH = lineCount*this.lineHeight; + let maxH2 = maxH; if (this.imageFitWidth && bin.w > this.w) { - const newH = bin.h*this.w/bin.w; - c = Math.ceil(newH/this.lineHeight); + maxH2 = bin.h*this.w/bin.w; + c = Math.ceil(maxH2/this.lineHeight); } lineCount = (c < lineCount ? c : lineCount); - let imageHeight = lineCount*this.lineHeight; + let imageHeight = (maxH2 < maxH ? maxH2 : maxH); imageHeight = (imageHeight <= bin.h ? imageHeight : bin.h); let imageWidth = (bin.h > imageHeight ? bin.w*imageHeight/bin.h : bin.w);