Skip to content

Commit 93d2545

Browse files
committed
Use stepy for custom text align
Such step defines forseen space for the text
1 parent 72e1db0 commit 93d2545

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

modules/hist/TPavePainter.mjs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -506,12 +506,11 @@ class TPavePainter extends ObjectPainter {
506506
const align = entry.fTextAlign || this.textatt.align,
507507
halign = Math.floor(align/10),
508508
valign = align % 10,
509-
tsize = this.textatt.getAltSize(entry.fTextSize, pad_height),
510509
x = entry.fX ? entry.fX*width : (halign === 1 ? margin_x : (halign === 2 ? width / 2 : width - margin_x)),
511-
y = entry.fY ? (1 - entry.fY)*height : (texty + (valign === 2 ? tsize / 2 : (valign === 3 ? tsize : 0))),
510+
y = entry.fY ? (1 - entry.fY)*height : (texty + (valign === 2 ? stepy / 2 : (valign === 3 ? stepy : 0))),
512511
sub_g = text_g.append('svg:g');
513512

514-
this.startTextDrawing(this.textatt.font, tsize, sub_g);
513+
this.startTextDrawing(this.textatt.font, this.textatt.getAltSize(entry.fTextSize, pad_height), sub_g);
515514

516515
this.drawText({ align, x, y, text: entry.fTitle, color,
517516
latex: (entry._typename === clTText) ? 0 : 1, draw_g: sub_g, fast });

0 commit comments

Comments
 (0)