|
444 | 444 | x = pad['fUxmin']; |
445 | 445 | } |
446 | 446 | return x; |
447 | | - }; |
| 447 | + } |
| 448 | + |
| 449 | + JSROOT.Painter.moveChildToEnd = function(child) { |
| 450 | + if (!child) return; |
| 451 | + var prnt = child.node().parentNode; |
| 452 | + prnt.removeChild(child.node()); |
| 453 | + prnt.appendChild(child.node()); |
| 454 | + } |
| 455 | + |
448 | 456 |
|
449 | 457 | JSROOT.Painter.ytoPad = function(y, pad) { |
450 | 458 | if (pad['fLogy']) { |
|
1114 | 1122 |
|
1115 | 1123 | pthis[drag_rect_name].attr("x", x); |
1116 | 1124 | pthis[drag_rect_name].attr("y", y); |
| 1125 | + |
| 1126 | + JSROOT.Painter.moveChildToEnd(pthis[drag_rect_name]); |
| 1127 | + |
1117 | 1128 | d3.event.sourceEvent.stopPropagation(); |
1118 | 1129 | }).on("dragend", function() { |
1119 | 1130 | d3.event.sourceEvent.preventDefault(); |
|
1176 | 1187 | if (h+dy > pad_h) acc_y += dy; else h+=dy; |
1177 | 1188 | pthis[drag_rect_name].attr("width", w); |
1178 | 1189 | pthis[drag_rect_name].attr("height", h); |
| 1190 | + |
| 1191 | + JSROOT.Painter.moveChildToEnd(pthis[drag_rect_name]); |
| 1192 | + |
1179 | 1193 | d3.event.sourceEvent.stopPropagation(); |
1180 | 1194 | }).on( "dragend", function() { |
1181 | 1195 | d3.event.sourceEvent.preventDefault(); |
|
2339 | 2353 | var fontDetails = JSROOT.Painter.getFontDetails(pavetext['fTextFont']); |
2340 | 2354 | var lwidth = pavetext['fBorderSize'] ? pavetext['fBorderSize'] : 0; |
2341 | 2355 |
|
2342 | | - if (this.main_rect == null) |
| 2356 | + var pthis = this; |
| 2357 | + |
| 2358 | + if (this.main_rect == null) { |
2343 | 2359 | this.main_rect = this.svg_pad(true).append("rect"); |
| 2360 | + } else { |
| 2361 | + // force main rect of the stat box be last item in the primitives to |
| 2362 | + // kept it on the top - for instance when colz is created |
| 2363 | + JSROOT.Painter.moveChildToEnd(this.main_rect); |
| 2364 | + } |
2344 | 2365 |
|
2345 | 2366 | this.main_rect |
2346 | 2367 | .attr("x", pos_x) |
|
2351 | 2372 | .style("stroke-width", lwidth ? 1 : 0) |
2352 | 2373 | .style("stroke", lcolor); |
2353 | 2374 |
|
2354 | | - var pthis = this; |
2355 | | - |
2356 | 2375 | this.AddDrag("stat", this.main_rect, { |
2357 | 2376 | move : function(x, y, dx, dy) { |
2358 | 2377 | pthis.draw_g.attr("transform", "translate(" + x + "," + y + ")"); |
|
0 commit comments