Skip to content

Commit cd2d268

Browse files
committed
Minimal fix for TPaveStats drawing
git-svn-id: https://subversion.gsi.de/dabc/trunk/plugins/root/js@2694 bcbf6573-9a26-0410-9ebc-ce4ab7aade96
1 parent 30f9ad6 commit cd2d268

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

scripts/JSRootPainter.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2311,15 +2311,8 @@
23112311
var fontDetails = JSROOT.Painter.getFontDetails(pavetext['fTextFont']);
23122312
var lwidth = pavetext['fBorderSize'] ? pavetext['fBorderSize'] : 0;
23132313

2314-
if (this.main_rect == null) {
2314+
if (this.main_rect == null)
23152315
this.main_rect = this.svg_pad(true).append("rect");
2316-
} else {
2317-
// force main rect of the stat box be last item in the primitives to
2318-
// kept it on the top
2319-
//var prnt = this.main_rect.node().parentNode;
2320-
//prnt.removeChild(this.main_rect.node());
2321-
//prnt.appendChild(this.main_rect.node());
2322-
}
23232316

23242317
this.main_rect
23252318
.attr("x", pos_x)
@@ -2375,7 +2368,8 @@
23752368
if (maxlw > width)
23762369
font_size = Math.floor(font_size * (width / maxlw));
23772370

2378-
var stepy = height / nlines;
2371+
// for characters like 'p' or 'y' several more pixels required to stay in the box when drawn in last line
2372+
var stepy = (height - 0.2*font_size) / nlines;
23792373

23802374
if (nlines == 1) {
23812375
this.draw_g.append("text")
@@ -3966,7 +3960,7 @@
39663960
var shrink = 0.;
39673961

39683962
if (position < 0) {
3969-
shrink = -position/w + 0.01;
3963+
shrink = -position/w + 0.001;
39703964
this.shrink_frame_left += shrink;
39713965
} else
39723966
if ((this.shrink_frame_left > 0) && (position/w > this.shrink_frame_left)) {

0 commit comments

Comments
 (0)