Handle arrowheads better when thickness is specified
This commit is contained in:
parent
48a018ac2e
commit
69301a2743
File diff suppressed because one or more lines are too long
|
@ -37,8 +37,8 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
|
||||||
if (values.thickness == null) {values.thickness = ".075em"}
|
if (values.thickness == null) {values.thickness = ".075em"}
|
||||||
if (values.padding == null) {values.padding = ".2em"}
|
if (values.padding == null) {values.padding = ".2em"}
|
||||||
var mu = this.HTMLgetMu(span), scale = this.HTMLgetScale();
|
var mu = this.HTMLgetMu(span), scale = this.HTMLgetScale();
|
||||||
var p = HTMLCSS.length2em(values.padding,mu) * scale;
|
var p = HTMLCSS.length2em(values.padding,mu,1/HTMLCSS.em) * scale;
|
||||||
var t = HTMLCSS.length2em(values.thickness,mu) * scale;
|
var t = HTMLCSS.length2em(values.thickness,mu,1/HTMLCSS.em) * scale;
|
||||||
var SOLID = HTMLCSS.Em(t)+" solid";
|
var SOLID = HTMLCSS.Em(t)+" solid";
|
||||||
|
|
||||||
span = this.HTMLcreateSpan(span);
|
span = this.HTMLcreateSpan(span);
|
||||||
|
@ -137,9 +137,9 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
|
||||||
} else {
|
} else {
|
||||||
if (!svg) {svg = this.HTMLsvg(stack,H,D,W,t,values.mathcolor)}
|
if (!svg) {svg = this.HTMLsvg(stack,H,D,W,t,values.mathcolor)}
|
||||||
if (this.arrow) {
|
if (this.arrow) {
|
||||||
var l = Math.sqrt(W*W + (H+D)*(H+D));
|
var l = Math.sqrt(W*W + (H+D)*(H+D)), f = 1/l * 10*scale/HTMLCSS.em * t/.075;
|
||||||
w = W/l * 10*scale/HTMLCSS.em, h = (H+D)/l * 10*scale/HTMLCSS.em;
|
w = W * f; h = (H+D) * f; var x = W - t/2, y = t/2;
|
||||||
var x = W - t/2, y = t/2; if (y+h-.4*w < 0) {y = .4*w-h}
|
if (y+h-.4*w < 0) {y = .4*w-h}
|
||||||
this.HTMLsvgElement(svg.firstChild,"line",{
|
this.HTMLsvgElement(svg.firstChild,"line",{
|
||||||
x1:1, y1:this.HTMLpx(H+D-t), x2:this.HTMLpx(x-.7*w), y2:this.HTMLpx(y+.7*h)
|
x1:1, y1:this.HTMLpx(H+D-t), x2:this.HTMLpx(x-.7*w), y2:this.HTMLpx(y+.7*h)
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user