www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 594043e3301e95bfc76e441dccdddfb29e67b982
parent f4cc34706a7bec8ded0283849553abfb3d0d5650
Author: Davide P. Cervone <dpvc@union.edu>
Date:   Mon, 22 Apr 2013 08:26:38 -0400

Use ems (rounded to nearest pixel) for Chrome.  Rounding makes the placement work more reliably, while still being in relative units.  Resolves issue #443.

Diffstat:
Munpacked/jax/output/HTML-CSS/config.js | 2+-
Munpacked/jax/output/HTML-CSS/jax.js | 11+++++++----
2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/unpacked/jax/output/HTML-CSS/config.js b/unpacked/jax/output/HTML-CSS/config.js @@ -24,7 +24,7 @@ MathJax.OutputJax["HTML-CSS"] = MathJax.OutputJax({ id: "HTML-CSS", - version: "2.1.2", + version: "2.1.3", directory: MathJax.OutputJax.directory + "/HTML-CSS", extensionDir: MathJax.OutputJax.extensionDir + "/HTML-CSS", autoloadDir: MathJax.OutputJax.directory + "/HTML-CSS/autoload", diff --git a/unpacked/jax/output/HTML-CSS/jax.js b/unpacked/jax/output/HTML-CSS/jax.js @@ -814,6 +814,11 @@ if (Math.abs(m) < .0006) {return "0em"} return m.toFixed(3).replace(/\.?0+$/,"") + "em"; }, + EmRounded: function (m) { + m = (Math.round(m*HTMLCSS.em)+.05)/HTMLCSS.em; + if (Math.abs(m) < .0006) {return "0em"} + return m.toFixed(3).replace(/\.?0+$/,"") + "em"; + }, unEm: function (m) { return parseFloat(m); }, @@ -2811,10 +2816,8 @@ Chrome: function (browser) { HTMLCSS.Augment({ - Em: HTMLCSS.Px, // vertical alignment is better in pixels (since around v20) - unEm: HTMLCSS.unPx, - chromeHeightBug: true, // heights can be 1px off from the explicitly set size - cloneNodeBug: true, // Chrome gets heights wrong with the cloned ones + Em: HTMLCSS.EmRounded, // vertical alignment needs help (since around v20) + cloneNodeBug: true, // Chrome gets heights wrong with the cloned ones rfuzz: .011, AccentBug: true, AdjustSurd: true,