www

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

commit b84f7772f44b5779db4c90233854e92bbe3f673a
parent ae3197913bc9b45d9826502f53388b15305acfe5
Author: Davide P. Cervone <dpvc@union.edu>
Date:   Thu, 22 May 2014 18:04:59 -0400

Fix zoom box sizes for tagged equations in HTML-CSS and NativeMML output.  Issue #824.

Diffstat:
Munpacked/jax/output/HTML-CSS/jax.js | 7+++++--
Munpacked/jax/output/NativeMML/jax.js | 1+
2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/unpacked/jax/output/HTML-CSS/jax.js b/unpacked/jax/output/HTML-CSS/jax.js @@ -777,7 +777,7 @@ this.idPostfix = "-zoom"; jax.root.toHTML(span,span); this.idPostfix = ""; this.zoomScale = 1; - var width = jax.root.HTMLspanElement().bbox.width; + var width = jax.root.HTMLspanElement().bbox.width, cwidth; if (width) { // Handle full-width displayed equations // FIXME: this is a hack for now @@ -785,7 +785,10 @@ var id = (jax.root.id||"MathJax-Span-"+jax.root.spanID)+"-zoom"; var child = document.getElementById(id).firstChild; while (child && child.style.width !== width) {child = child.nextSibling} - if (child) {child.style.width = "100%"} + if (child) { + var cwidth = child.offsetWidth; child.style.width = "100%"; + if (cwidth > Mw) {span.style.width = (cwidth+100)+"px"} + } } // // Get height and width of zoomed math and original math diff --git a/unpacked/jax/output/NativeMML/jax.js b/unpacked/jax/output/NativeMML/jax.js @@ -432,6 +432,7 @@ Zoom: function (jax,span,math,Mw,Mh) { jax.root.toNativeMML(span); if (this.msieIE8HeightBug) {span.style.position = "absolute"} + if (nMML.widthBug) {span.style.width = span.parentNode.style.width = ""} var mW = math.offsetWidth || math.scrollWidth, mH = math.offsetHeight || math.scrollHeight; var zW = span.offsetWidth, zH = span.offsetHeight;