Skip to content

Commit 3f8e2e5

Browse files
committed
Fix - renable correct highlight of TGraphErrors
Due to change in SVG layers, used for highlight, extra SVG elements are required to handle mouse events used for tooltips showing
1 parent 03f1a0b commit 3f8e2e5

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

scripts/JSRootPainter.more.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1322,7 +1322,7 @@
13221322
.call(this.fillatt.func);
13231323
}
13241324

1325-
if (this.options.Rect)
1325+
if (this.options.Rect) {
13261326
nodes.filter(function(d) { return (d.exlow > 0) && (d.exhigh > 0) && (d.eylow > 0) && (d.eyhigh > 0); })
13271327
.append("svg:rect")
13281328
.attr("x", function(d) { d.rect = true; return d.grx0; })
@@ -1331,6 +1331,7 @@
13311331
.attr("height", function(d) { return d.gry0 - d.gry2; })
13321332
.call(this.fillatt.func)
13331333
.call(this.options.Rect === 2 ? this.lineatt.func : function() {});
1334+
}
13341335

13351336
this.error_size = 0;
13361337

@@ -1371,10 +1372,18 @@
13711372
this.error_size = lw;
13721373

13731374
lw = Math.floor((this.lineatt.width-1)/2); // one should take into account half of end-cup line width
1374-
nodes.filter(function(d) { return (d.exlow > 0) || (d.exhigh > 0) || (d.eylow > 0) || (d.eyhigh > 0); })
1375-
.append("svg:path")
1375+
1376+
var visible = nodes.filter(function(d) { return (d.exlow > 0) || (d.exhigh > 0) || (d.eylow > 0) || (d.eyhigh > 0); });
1377+
if (!JSROOT.BatchMode && (JSROOT.gStyle.Tooltip > 0))
1378+
visible.append("svg:path")
1379+
.style("stroke", "none")
1380+
.style("fill", "none")
1381+
.style("pointer-events", "visibleFill")
1382+
.attr("d", function(d) { return "M"+d.grx0+","+d.gry0+"h"+(d.grx2-d.grx0)+"v"+(d.gry2-d.gry0)+"h"+(d.grx0-d.grx2)+"z"; });
1383+
1384+
visible.append("svg:path")
13761385
.call(this.lineatt.func)
1377-
.style('fill', "none")
1386+
.style("fill", "none")
13781387
.attr("d", function(d) {
13791388
d.error = true;
13801389
return ((d.exlow > 0) ? mm + (d.grx0+lw) + "," + d.grdx0 + vleft : "") +

0 commit comments

Comments
 (0)