www

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

commit 283cff42892124f21f8aa7065a40a93f34988874
parent 982d9f92f74f0e32a3a7766fed32b007444c7532
Author: Davide P. Cervone <dpvc@union.edu>
Date:   Thu, 20 Mar 2014 05:50:04 -0400

Merge remote-tracking branch 'dpvc/issue763' into develop.  Issue #763.

Diffstat:
Munpacked/jax/output/HTML-CSS/autoload/mglyph.js | 3---
Munpacked/jax/output/SVG/autoload/mglyph.js | 7++++---
2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/unpacked/jax/output/HTML-CSS/autoload/mglyph.js b/unpacked/jax/output/HTML-CSS/autoload/mglyph.js @@ -71,17 +71,14 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () { var mu = this.HTMLgetMu(span); img = HTMLCSS.addElement(span,"img",{isMathJax:true, src:values.src, alt:values.alt, title:values.alt}); if (values.width) { - if (String(values.width).match(/^\s*-?\d+\s*$/)) {values.width += "px"} img.style.width = HTMLCSS.Em(HTMLCSS.length2em(values.width,mu,this.img.img.width/HTMLCSS.em)); } if (values.height) { - if (String(values.height).match(/^\s*-?\d+\s*$/)) {values.height += "px"} img.style.height = HTMLCSS.Em(HTMLCSS.length2em(values.height,mu,this.img.img.height/HTMLCSS.em)); } span.bbox.w = span.bbox.rw = img.offsetWidth/HTMLCSS.em; span.bbox.h = img.offsetHeight/HTMLCSS.em; if (values.valign) { - if (String(values.valign).match(/^\s*-?\d+\s*$/)) {values.valign += "px"} span.bbox.d = -HTMLCSS.length2em(values.valign,mu,this.img.img.height/HTMLCSS.em); img.style.verticalAlign = HTMLCSS.Em(-span.bbox.d); span.bbox.h -= span.bbox.d; diff --git a/unpacked/jax/output/SVG/autoload/mglyph.js b/unpacked/jax/output/SVG/autoload/mglyph.js @@ -37,9 +37,10 @@ MathJax.Hub.Register.StartupHook("SVG Jax Ready",function () { type: "image", removeable: false, Init: function (img,w,h,align,mu,def) { if (def == null) {def = {}} - var W = img.width*1000/SVG.em, H = img.height*1000/SVG.em, y = 0; - if (w !== "") {W = SVG.length2em(w,mu,W)} - if (h !== "") {H = SVG.length2em(h,mu,H)} + var W = img.width*1000/SVG.em, H = img.height*1000/SVG.em; + var WW = W, HH = H, y = 0; + if (w !== "") {W = SVG.length2em(w,mu,WW); H = (WW ? W/WW * HH : 0)} + if (h !== "") {H = SVG.length2em(h,mu,HH); if (w === "") {W = (HH ? H/HH * WW : 0)}} if (align !== "" && align.match(/\d/)) {y = SVG.length2em(align,mu); def.y = -y} def.height = Math.floor(H); def.width = Math.floor(W); def.transform = "translate(0,"+H+") matrix(1 0 0 -1 0 0)";