Skip to content

Commit 8bab1a2

Browse files
committed
Fix - update stats which was created by hist painter
Normaly stats created already in TWebCanvas, but not always
1 parent 81d72b0 commit 8bab1a2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

modules/hist2d/THistPainter.mjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -994,7 +994,7 @@ class FunctionsHandler {
994994
#painter; // object painter to which functions belongs
995995
#pad_painter; // pad painter
996996

997-
constructor(painter, pp, funcs, statpainter) {
997+
constructor(painter, pp, funcs, statpainter, update_statpainter) {
998998
this.#painter = painter;
999999
this.#pad_painter = pp;
10001000

@@ -1053,6 +1053,8 @@ class FunctionsHandler {
10531053
const indx = painters.indexOf(statpainter);
10541054
if (indx >= 0)
10551055
painters.splice(indx, 1);
1056+
if (update_statpainter && (update_painters.indexOf(statpainter) < 0))
1057+
update_painters.push(statpainter);
10561058
}
10571059

10581060
// remove all function which are not found in new list of functions
@@ -1432,7 +1434,7 @@ class THistPainter extends ObjectPainter {
14321434
histo.fBins = obj.fBins;
14331435

14341436
// remove old functions, update existing, prepare to draw new one
1435-
this.#funcs_handler = new FunctionsHandler(this, pp, obj.fFunctions, statpainter);
1437+
this.#funcs_handler = new FunctionsHandler(this, pp, obj.fFunctions, statpainter, this.create_stats);
14361438

14371439
const changed_opt = (histo.fOption !== obj.fOption);
14381440
histo.fOption = obj.fOption;

0 commit comments

Comments
 (0)