Make zoom box handle overlaps properly, and position full-width tables better.
This commit is contained in:
parent
02066cb7cc
commit
c994ee9994
|
@ -450,7 +450,7 @@ MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () {
|
|||
}); box.appendChild(table);
|
||||
var labels = HTML.Element("mjx-stack");
|
||||
table.style.display = "inline-table"; if (!table.style.width) table.style.width = "auto";
|
||||
labels.style.verticalAlign = table.style.verticalAlign = "top";
|
||||
labels.style.verticalAlign = "top";
|
||||
node.style.verticalAlign = "";
|
||||
if (shift) table.style[margin] = CHTML.Em(shift);
|
||||
//
|
||||
|
|
|
@ -574,9 +574,17 @@
|
|||
var node = HTML.addElement(span,"mjx-chtml");
|
||||
this.idPostfix = "-zoom"; jax.root.toCommonHTML(node); this.idPostfix = "";
|
||||
//
|
||||
// Adjust margins to prevent overlaps at the edges
|
||||
//
|
||||
var style = node.style, bbox = jax.root.CHTML;
|
||||
if (bbox.t > bbox.h) style.marginTop = CHTML.Em(bbox.t-Math.max(bbox.h,CHTML.FONTDATA.lineH));
|
||||
if (bbox.b > bbox.d) style.marginBottom = CHTML.Em(bbox.b-Math.max(bbox.d,CHTML.FONTDATA.lineD));
|
||||
if (bbox.l < 0) style.paddingLeft = CHTML.Em(-bbox.l);
|
||||
if (bbox.r > bbox.w) style.marginRight = CHTML.Em(bbox.r-bbox.w);
|
||||
//
|
||||
// Get height and width of zoomed math and original math
|
||||
//
|
||||
node.style.position = "absolute";
|
||||
style.position = "absolute";
|
||||
var zW = node.offsetWidth, zH = node.offsetHeight,
|
||||
mH = math.firstChild.offsetHeight, mW = math.firstChild.offsetWidth;
|
||||
node.style.position = "";
|
||||
|
|
Loading…
Reference in New Issue
Block a user