Do not display maction when the selection is out of range. Fix issue 365.

This commit is contained in:
Frédéric Wang 2013-02-08 16:32:24 +01:00
parent 07c5ee1121
commit 4fefa49080
2 changed files with 6 additions and 2 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 * MathJax/jax/output/HTML-CSS/autoload/maction.js
@ -43,7 +45,7 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
toHTML: function (span,HW,D) { toHTML: function (span,HW,D) {
span = this.HTMLhandleSize(this.HTMLcreateSpan(span)); span.bbox = null; span = this.HTMLhandleSize(this.HTMLcreateSpan(span)); span.bbox = null;
var selected = this.selected(); var selected = this.selected();
if (selected) { if (selected.type !== "null") {
var box = selected.toHTML(span); var box = selected.toHTML(span);
if (D != null) {HTMLCSS.Remeasured(selected.HTMLstretchV(span,HW,D),span)} if (D != null) {HTMLCSS.Remeasured(selected.HTMLstretchV(span,HW,D),span)}
else if (HW != null) {HTMLCSS.Remeasured(selected.HTMLstretchH(span,HW),span)} else if (HW != null) {HTMLCSS.Remeasured(selected.HTMLstretchH(span,HW),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 * MathJax/jax/output/SVG/autoload/maction.js
@ -44,7 +46,7 @@ MathJax.Hub.Register.StartupHook("SVG Jax Ready",function () {
this.SVGgetStyles(); this.SVGgetStyles();
var svg = this.SVG(); var svg = this.SVG();
var selected = this.selected(); var selected = this.selected();
if (selected) { if (selected.type !== "null") {
svg.Add(this.SVGdataStretched(this.Get("selection")-1,HW,D)); svg.Add(this.SVGdataStretched(this.Get("selection")-1,HW,D));
this.SVGhandleHitBox(svg); this.SVGhandleHitBox(svg);
} }