Merge remote-tracking branch 'fred/issue365' into develop

Resolves issue #365.
This commit is contained in:
Davide P. Cervone 2013-03-21 09:17:55 -04:00
commit 5709ab189b
3 changed files with 24 additions and 17 deletions

View File

@ -1,3 +1,5 @@
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/*************************************************************
*
* MathJax/jax/output/HTML-CSS/autoload/maction.js
@ -41,15 +43,19 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
HTMLtooltip: HTMLCSS.addElement(document.body,"div",{id:"MathJax_Tooltip"}),
toHTML: function (span,HW,D) {
span = this.HTMLhandleSize(this.HTMLcreateSpan(span)); span.bbox = null;
var selected = this.selected();
if (selected) {
var box = selected.toHTML(span);
if (D != null) {HTMLCSS.Remeasured(selected.HTMLstretchV(span,HW,D),span)}
else if (HW != null) {HTMLCSS.Remeasured(selected.HTMLstretchH(span,HW),span)}
else {HTMLCSS.Measured(box,span)}
this.HTMLhandleHitBox(span);
if (selected.type == "null") {
span = this.HTMLcreateSpan(span);
span.bbox = this.HTMLzeroBBox();
return span;
}
span = this.HTMLhandleSize(this.HTMLcreateSpan(span)); span.bbox = null;
var box = selected.toHTML(span);
if (D != null) {HTMLCSS.Remeasured(selected.HTMLstretchV(span,HW,D),span)}
else if (HW != null) {
HTMLCSS.Remeasured(selected.HTMLstretchH(span,HW),span)
} else {HTMLCSS.Measured(box,span)}
this.HTMLhandleHitBox(span);
this.HTMLhandleSpace(span);
this.HTMLhandleColor(span);
return span;

View File

@ -1641,7 +1641,7 @@
var SPAN = this.HTMLspanElement();
if (SPAN && (SPAN.parentNode === span || (SPAN.parentNode||{}).parentNode === span)) {
while (SPAN.firstChild) {SPAN.removeChild(SPAN.firstChild)}
SPAN.bbox = {w:0, h:0, d:0, lw:0, rw:0};
SPAN.bbox = this.HTMLzeroBBox();
SPAN.scale = 1; SPAN.isMultChar = SPAN.HH = null;
SPAN.style.cssText = "";
return SPAN;
@ -1653,7 +1653,7 @@
if (this["class"]) {span.className += " "+this["class"]}
if (!this.spanID) {this.spanID = HTMLCSS.GetID()}
span.id = (this.id || "MathJax-Span-"+this.spanID) + HTMLCSS.idPostfix;
span.bbox = {w:0, h:0, d:0, lw:0, rw:0}; this.styles = {};
span.bbox = this.HTMLzeroBBox(); this.styles = {};
if (this.style) {
span.style.cssText = this.style;
if (span.style.fontSize) {this.mathsize = span.style.fontSize; span.style.fontSize = ""}
@ -1919,7 +1919,7 @@
var variant = this.HTMLgetVariant();
for (var i = 0, m = this.data.length; i < m; i++)
{if (this.data[i]) {this.data[i].toHTML(span,variant)}}
if (!span.bbox) {span.bbox = {w:0, h:0, d:0, rw:0, lw:0}}
if (!span.bbox) {span.bbox = this.HTMLzeroBBox()}
var text = this.data.join(""), bbox = span.bbox;
if (bbox.skew && text.length !== 1) {delete bbox.skew}
if (bbox.rw > bbox.w && text.length === 1 && !variant.noIC) {
@ -1939,7 +1939,7 @@
var variant = this.HTMLgetVariant();
for (var i = 0, m = this.data.length; i < m; i++)
{if (this.data[i]) {this.data[i].toHTML(span,variant)}}
if (!span.bbox) {span.bbox = {w:0, h:0, d:0, rw:0, lw:0}}
if (!span.bbox) {span.bbox = this.HTMLzeroBBox()}
if (this.data.join("").length !== 1) {delete span.bbox.skew}
this.HTMLhandleSpace(span);
this.HTMLhandleColor(span);
@ -1981,7 +1981,7 @@
//
for (var i = 0, m = this.data.length; i < m; i++)
{if (this.data[i]) {this.data[i].toHTML(span,variant,this.HTMLremap,mapchars)}}
if (!span.bbox) {span.bbox = {w:0, h:0, d:0, rw:0, lw:0}}
if (!span.bbox) {span.bbox = this.HTMLzeroBBox()}
if (text.length !== 1) {delete span.bbox.skew}
//
// Handle combining characters by adding a non-breaking space and removing that width
@ -2108,7 +2108,7 @@
{variant = {bold:variant.bold, italic:variant.italic, fontInherit: true}}
for (var i = 0, m = this.data.length; i < m; i++)
{if (this.data[i]) {this.data[i].toHTML(span,variant)}}
if (!span.bbox) {span.bbox = {w:0, h:0, d:0, rw:0, lw:0}}
if (!span.bbox) {span.bbox = this.HTMLzeroBBox()}
if (this.data.join("").length !== 1) {delete span.bbox.skew}
this.HTMLhandleSpace(span);
this.HTMLhandleColor(span);

View File

@ -1,3 +1,5 @@
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/*************************************************************
*
* MathJax/jax/output/SVG/autoload/maction.js
@ -44,10 +46,9 @@ MathJax.Hub.Register.StartupHook("SVG Jax Ready",function () {
this.SVGgetStyles();
var svg = this.SVG();
var selected = this.selected();
if (selected) {
svg.Add(this.SVGdataStretched(this.Get("selection")-1,HW,D));
this.SVGhandleHitBox(svg);
}
if (selected.type == "null") {this.SVGsaveData(svg);return svg;}
svg.Add(this.SVGdataStretched(this.Get("selection")-1,HW,D));
this.SVGhandleHitBox(svg);
this.SVGhandleSpace(svg);
this.SVGhandleColor(svg);
this.SVGsaveData(svg);