mirror of
https://gitlab.kit.edu/uskyk/typicalc.git
synced 2024-11-08 18:30:42 +00:00
Merge branch 'master' of https://git.scc.kit.edu/pse-typinferenz/typicalc
This commit is contained in:
commit
72d7523070
@ -85,7 +85,31 @@ window.MathJax = {
|
||||
const OutputJax = startup.getOutputJax();
|
||||
const html = mathjax.document(root, {InputJax, OutputJax});
|
||||
html.render();
|
||||
window.svgPanZoomFun(root.querySelector("svg"));
|
||||
const svg = root.querySelector("svg");
|
||||
window.svgPanZoomFun(svg);
|
||||
var nodeIterator = svg.querySelectorAll("g[data-mml-node='mtr']");
|
||||
for (var a of nodeIterator) {
|
||||
var left = null;
|
||||
var i = 0;
|
||||
for (var node of a.childNodes) {
|
||||
if (i == 1 || i == 3) {
|
||||
i += 1;
|
||||
continue;
|
||||
}
|
||||
var bbox = node.getBBox();
|
||||
var mat = node.transform.baseVal[0];
|
||||
if (mat != undefined) {
|
||||
bbox.x += mat.matrix.e;
|
||||
}
|
||||
if (left == null) {
|
||||
left = bbox.x + bbox.width;
|
||||
} else {
|
||||
mat.matrix.e -= bbox.x - left;
|
||||
left = bbox.x + mat.matrix.e + bbox.width;
|
||||
}
|
||||
i += 1;
|
||||
}
|
||||
}
|
||||
if (callback != null) {
|
||||
callback(html);
|
||||
}
|
||||
@ -108,4 +132,4 @@ window.MathJax = {
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user