Better construct empty frames when maction@selection is invalid
This commit is contained in:
parent
4fefa49080
commit
d0b024243b
|
@ -43,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.type !== "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);
|
||||
if (selected.type == "null") {
|
||||
span = this.HTMLcreateSpan(span);
|
||||
span.bbox = {h:0, d:0, w:0, lw:0, rw:0};
|
||||
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;
|
||||
|
|
|
@ -46,10 +46,9 @@ MathJax.Hub.Register.StartupHook("SVG Jax Ready",function () {
|
|||
this.SVGgetStyles();
|
||||
var svg = this.SVG();
|
||||
var selected = this.selected();
|
||||
if (selected.type !== "null") {
|
||||
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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user