Skip to content

Commit

Permalink
Build with splitline align
Browse files Browse the repository at this point in the history
  • Loading branch information
linev committed Nov 26, 2024
1 parent c22366a commit b498c9b
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions build/jsroot.js
Original file line number Diff line number Diff line change
Expand Up @@ -9862,7 +9862,8 @@ const latex_features = [
{ name: '#tilde{', accent: '\u02DC', hasw: true }, // '\u0303'
{ name: '#slash{', accent: '\u2215' }, // '\u0337'
{ name: '#vec{', accent: '\u02ED', hasw: true }, // '\u0350' arrowhead
{ name: '#frac{', twolines: 'line' },
{ name: '#frac{', twolines: 'line', middle: true },
{ name: '#splitmline{', twolines: true, middle: true },
{ name: '#splitline{', twolines: true },
{ name: '#sqrt[', arg: 'int', sqrt: true }, // root with arbitrary power
{ name: '#sqrt{', sqrt: true }, // square root
Expand Down Expand Up @@ -10271,15 +10272,16 @@ function parseLatex(node, arg, label, curr) {
curr.twolines = true;

const line1 = extractSubLabel(), line2 = extractSubLabel(true);
if ((line1 === -1) || (line2 === -1)) return false;
if ((line1 === -1) || (line2 === -1))
return false;

const gg = createGG(),
fscale = (curr.parent && curr.parent.twolines) ? 0.7 : 1,
fscale = curr.parent?.twolines ? 0.7 : 1,
subpos1 = createSubPos(fscale);

parseLatex(gg, arg, line1, subpos1);

const path = (found.twolines === 'line') ? createPath(gg) : null,
const path = found.twolines === 'line' ? createPath(gg) : null,
subpos2 = createSubPos(fscale);

parseLatex(gg, arg, line2, subpos2);
Expand All @@ -10288,9 +10290,9 @@ function parseLatex(node, arg, label, curr) {
dw = subpos1.rect.width - subpos2.rect.width,
dy = -curr.fsize*0.35; // approximate position of middle line

positionGNode(subpos1, (dw < 0 ? -dw/2 : 0), dy - subpos1.rect.y2, true);
positionGNode(subpos1, found.middle && (dw < 0) ? -dw/2 : 0, dy - subpos1.rect.y2, true);

positionGNode(subpos2, (dw > 0 ? dw/2 : 0), dy - subpos2.rect.y1, true);
positionGNode(subpos2, found.middle && (dw > 0) ? dw/2 : 0, dy - subpos2.rect.y1, true);

path?.attr('d', `M0,${Math.round(dy)}h${Math.round(w - curr.fsize*0.1)}`);

Expand Down Expand Up @@ -57900,10 +57902,14 @@ class PointsCreator {
let k = 1;

// special dots
if (!args.style) k = 1.1; else
if (args.style === 1) k = 0.3; else
if (args.style === 6) k = 0.5; else
if (args.style === 7) k = 0.7;
if (!args.style)
k = 1.1;
else if (args.style === 1)
k = 0.3;
else if (args.style === 6)
k = 0.5;
else if (args.style === 7)
k = 0.7;

const makePoints = texture => {
const material_args = { size: 3*this.scale*k };
Expand All @@ -57928,7 +57934,7 @@ class PointsCreator {
const handler = new TAttMarkerHandler({ style: args.style, color: args.color, size: 7 }),
w = handler.fill ? 1 : 7,
imgdata = `<svg width="64" height="64" xmlns="${nsSVG}">` +
`<path d="${handler.create(32, 32)}" style="stroke: ${handler.getStrokeColor()}; stroke-width: ${w}; fill: ${handler.getFillColor()}"></path>`+
`<path d="${handler.create(32, 32)}" style="stroke: ${handler.getStrokeColor()}; stroke-width: ${w}; fill: ${args.fill ?? handler.getFillColor()}"></path>`+
'</svg>',
dataUrl = prSVG + (isNodeJs() ? imgdata : encodeURIComponent(imgdata));
let promise;
Expand Down Expand Up @@ -78213,7 +78219,7 @@ let TH2Painter$2 = class TH2Painter extends THistPainter {
if (this.options.TextLine)
text += '\xB1' + lble;
else
text = `#splitline{${text}}{#pm${lble}}`;
text = `#splitmline{${text}}{#pm${lble}}`;
}

let x, y, width, height;
Expand Down Expand Up @@ -152387,7 +152393,7 @@ class TGraph2DPainter extends ObjectPainter {
if (!this.options.Circles || this.options.Color)
color = palette?.calcColor(lvl, levels.length) ?? this.getColor(graph.fMarkerColor);

const pr = pnts.createPoints({ color, style: this.options.Circles ? 4 : graph.fMarkerStyle }).then(mesh => {
const pr = pnts.createPoints({ color, fill: 'white', style: this.options.Circles ? 4 : graph.fMarkerStyle }).then(mesh => {
mesh.graph = graph;
mesh.fp = fp;
mesh.tip_color = (graph.fMarkerColor === 3) ? 0xFF0000 : 0x00FF00;
Expand Down

0 comments on commit b498c9b

Please sign in to comment.