commit 48e3ed1047e936cdca8086eeadeaff8890bbfc51
parent 169d08bcd7b38b90b191b5755121f6c5e4411db9
Author: Davide P. Cervone <dpvc@union.edu>
Date: Wed, 14 Oct 2015 08:01:41 -0400
Merge branch 'issue1283' into develop. Issue #1283.
Diffstat:
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/unpacked/jax/output/CommonHTML/jax.js b/unpacked/jax/output/CommonHTML/jax.js
@@ -972,8 +972,8 @@
if (list.length) this.addCharList(node.firstChild,list,bbox);
bbox.clean();
if (bbox.d < 0) {bbox.D = bbox.d; bbox.d = 0}
- if (bbox.h - bbox.a) node.firstChild.style[bbox.h - bbox.a < 0 ? "marginTop" : "paddingTop"] = this.Em(bbox.h-bbox.a);
- if (bbox.d > -bbox.b) node.firstChild.style.paddingBottom = this.Em(bbox.d+bbox.b);
+ if (bbox.h - bbox.a) node.firstChild.style[bbox.h - bbox.a < 0 ? "marginTop" : "paddingTop"] = this.EmRounded(bbox.h-bbox.a);
+ if (bbox.d > -bbox.b) node.firstChild.style.paddingBottom = this.EmRounded(bbox.d+bbox.b);
return bbox;
},
@@ -1196,6 +1196,11 @@
if (Math.abs(m) < .001) return "0";
return (m.toFixed(3).replace(/\.?0+$/,""))+"em";
},
+ EmRounded: function (m) {
+ m = (Math.round(m*CHTML.em)+.05)/CHTML.em;
+ if (Math.abs(m) < .0006) {return "0em"}
+ return m.toFixed(3).replace(/\.?0+$/,"") + "em";
+ },
unEm: function (m) {
return parseFloat(m);
},