From fe0d977494f1253631045ddcf136bd00465de7d0 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Tue, 17 Feb 2015 16:03:25 -0500 Subject: [PATCH] Handle padding in measured children when noReflows is used (e.g., in maction tags around operators). --- unpacked/jax/output/HTML-CSS/jax.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/unpacked/jax/output/HTML-CSS/jax.js b/unpacked/jax/output/HTML-CSS/jax.js index ca3e3f7f1..0bbe964fb 100644 --- a/unpacked/jax/output/HTML-CSS/jax.js +++ b/unpacked/jax/output/HTML-CSS/jax.js @@ -892,8 +892,14 @@ return HD; }, getW: function (span) { - if (span.bbox && this.config.noReflows && span.bbox.exactW !== false) {return span.bbox.w} var W, H, w = (span.bbox||{}).w, start = span; + if (span.bbox && this.config.noReflows && span.bbox.exactW !== false) { + if (!span.bbox.exactW) { + if (span.style.paddingLeft) w += this.unEm(span.style.paddingLeft)*(span.scale||1); + if (span.style.paddingRight) w += this.unEm(span.style.paddingRight)*(span.scale||1); + } + return w; + } if (span.bbox && span.bbox.exactW) {return w} if ((span.bbox && w >= 0 && !this.initialSkipBug && !this.msieItalicWidthBug) || this.negativeBBoxes || !span.firstChild) {