From ce81e9fcd074dc8144e6a783bcbaa35803b9dae0 Mon Sep 17 00:00:00 2001 From: Tarun Gupta Date: Wed, 5 Jun 2019 19:58:22 +0530 Subject: [PATCH] #942 Parsed the padding before adding as I found some books where these values are coming in as strings appended with px like "38px" --- src/rendition.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rendition.js b/src/rendition.js index 70e41cadc..557225331 100644 --- a/src/rendition.js +++ b/src/rendition.js @@ -939,7 +939,7 @@ class Rendition { let computed = contents.window.getComputedStyle(contents.content, null); let height = (contents.content.offsetHeight - (parseFloat(computed.paddingTop) + parseFloat(computed.paddingBottom))) * .95; - let horizontalPadding = computed.paddingLeft + computed.paddingRight; + let horizontalPadding = parseFloat(computed.paddingLeft) + parseFloat(computed.paddingRight); contents.addStylesheetRules({ "img" : {