Skip to content

Commit e72940c

Browse files
committed
Preserve auto colors in THStack #277
If stack histogram got auto colors, they will be preserved in updates.
1 parent 0bdf3b3 commit e72940c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

modules/hist/THStackPainter.mjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,10 @@ class THStackPainter extends ObjectPainter {
366366
} else {
367367
for (let indx = 0; indx < nhists; ++indx) {
368368
const rindx = this.options.horder ? indx : nhists - indx - 1,
369-
hist = hlst.arr[rindx],
370-
hopt = hlst.opt[rindx];
369+
hist = hlst.arr[rindx], hopt = hlst.opt[rindx], hist0 = this.painters[indx].getHisto();
370+
if (this.options._pfc) hist.fFillColor = hist0.fFillColor;
371+
if (this.options._plc) hist.fLineColor = hist0.fLineColor;
372+
if (this.options._pmc) hist.fMarkerColor = hist0.fMarkerColor;
371373
this.painters[indx].updateObject(hist, hopt || hist.fOption || this.options.hopt);
372374
}
373375
}

0 commit comments

Comments
 (0)