Skip to content

Commit 7c2c826

Browse files
committed
Fix - tooltips handling for TH1 hbar drawings
1 parent 99f3ff5 commit 7c2c826

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

changes.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
## Changes in 5.3.x
44
1. Fix - use FontSize when draw TLegend entries
5-
2. Fix - correctly show th2 overflow stats
5+
2. Fix - correctly show TH2 overflow stats
6+
3. Fix - tooltips handling for TH1 hbar drawings
7+
68

79
## Changes in 5.3.1
810
1. Fix - show TH2 projections also when tooltip is disabled

scripts/JSRootPainter.hist.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5708,7 +5708,7 @@
57085708
grx1, midx, grx2, gry1, midy, gry2, gapx = 2,
57095709
left = this.GetSelectIndex("x", "left", -1),
57105710
right = this.GetSelectIndex("x", "right", 2),
5711-
l = left, r = right;
5711+
l = left, r = right, pnt_x = pnt.x, pnt_y = pnt.y;
57125712

57135713
function GetBinGrX(i) {
57145714
var xx = painter.GetBinX(i);
@@ -5722,8 +5722,10 @@
57225722
return Math.round(pmain.gry(yy));
57235723
}
57245724

5725-
var pnt_x = pmain.swap_xy ? pnt.y : pnt.x,
5726-
pnt_y = pmain.swap_xy ? pnt.x : pnt.y;
5725+
if (pmain.swap_xy) {
5726+
var d = pnt.x; pnt_x = pnt_y; pnt_y = d;
5727+
d = height; height = width; width = d;
5728+
}
57275729

57285730
while (l < r-1) {
57295731
var m = Math.round((l+r)*0.5), xx = GetBinGrX(m);

0 commit comments

Comments
 (0)