Skip to content

Commit 0858073

Browse files
committed
Correct tooltip also for TPolyMarker3D
1 parent c6c1080 commit 0858073

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

scripts/JSRootPainter.hist3d.js

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3350,6 +3350,7 @@
33503350
main.toplevel.add(mesh);
33513351

33523352
mesh.tip_color = (poly.fMarkerColor === 3) ? 0xFF0000 : 0x00FF00;
3353+
mesh.tip_name = poly.fName || "Poly3D";
33533354
mesh.poly = poly;
33543355
mesh.painter = main;
33553356
mesh.scale0 = 0.7*pnts.scale;
@@ -3361,24 +3362,27 @@
33613362

33623363
indx = this.index[indx];
33633364

3364-
var p = this.painter;
3365-
3366-
var tip = { info: "bin: " + indx/3 + "<br/>" +
3367-
"x: " + p.x_handle.format(this.poly.fP[indx]) + "<br/>" +
3368-
"y: " + p.y_handle.format(this.poly.fP[indx+1]) + "<br/>" +
3369-
"z: " + p.z_handle.format(this.poly.fP[indx+2]) };
3370-
3371-
var grx = p.grx(this.poly.fP[indx]),
3365+
var p = this.painter,
3366+
grx = p.grx(this.poly.fP[indx]),
33723367
gry = p.gry(this.poly.fP[indx+1]),
33733368
grz = p.grz(this.poly.fP[indx+2]);
33743369

3375-
tip.x1 = grx - this.scale0; tip.x2 = grx + this.scale0;
3376-
tip.y1 = gry - this.scale0; tip.y2 = gry + this.scale0;
3377-
tip.z1 = grz - this.scale0; tip.z2 = grz + this.scale0;
3378-
3379-
tip.color = this.tip_color;
3370+
return {
3371+
x1: grx - this.scale0,
3372+
x2: grx + this.scale0,
3373+
y1: gry - this.scale0,
3374+
y2: gry + this.scale0,
3375+
z1: grz - this.scale0,
3376+
z2: grz + this.scale0,
3377+
color: this.tip_color,
3378+
lines: [ this.tip_name,
3379+
"pnt: " + indx/3,
3380+
"x: " + p.x_handle.format(this.poly.fP[indx]),
3381+
"y: " + p.y_handle.format(this.poly.fP[indx+1]),
3382+
"z: " + p.z_handle.format(this.poly.fP[indx+2])
3383+
]
3384+
}
33803385

3381-
return tip;
33823386
}
33833387

33843388
main.Render3D(100); // set large timeout to be able draw other points

0 commit comments

Comments
 (0)