Skip to content

Commit 30f7a94

Browse files
committed
Fix - keep stat painter even when object is not there
Server-side histogram may not have TPaveStats object, which is shown on client side. Therefore not remove statpainter when doing histogram update.
1 parent d6267bd commit 30f7a94

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

scripts/JSRootPainter.hist.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2225,15 +2225,12 @@
22252225
// The only that could be done is update of content
22262226

22272227
// check only stats bit, later other settings can be monitored
2228+
var statpainter = this.FindPainterFor(this.FindStat());
22282229
if (histo.TestBit(JSROOT.TH1StatusBits.kNoStats) != obj.TestBit(JSROOT.TH1StatusBits.kNoStats)) {
22292230
histo.fBits = obj.fBits;
2230-
2231-
var statpainter = this.FindPainterFor(this.FindStat());
22322231
if (statpainter) statpainter.Enabled = !histo.TestBit(JSROOT.TH1StatusBits.kNoStats);
22332232
}
22342233

2235-
// if (histo.TestBit(JSROOT.TH1StatusBits.kNoStats)) this.ToggleStat();
2236-
22372234
// special treatment for webcanvas - also name can be changed
22382235
if (this.snapid !== undefined)
22392236
histo.fName = obj.fName;
@@ -2349,6 +2346,11 @@
23492346
}
23502347
}
23512348

2349+
if (statpainter) {
2350+
var indx = painters.indexOf(statpainter);
2351+
if (indx >= 0) painters.splice(indx, 1);
2352+
}
2353+
23522354
// remove all function which are not found in new list of primitives
23532355
if (pp && (painters.length > 0))
23542356
pp.CleanPrimitives(function(p) { return painters.indexOf(p) >= 0; });

0 commit comments

Comments
 (0)