@@ -78103,8 +78103,8 @@ class TPadPainter extends ObjectPainter {
7810378103
7810478104 for (let k = this.painters.length - 1; k >= 0; --k) {
7810578105 const subp = this.painters[k];
78106- if (selector(subp)) {
78107- subp.cleanup();
78106+ if (!subp || selector(subp)) {
78107+ subp? .cleanup();
7810878108 this.painters.splice(k, 1);
7810978109 is_any = true;
7811078110 }
@@ -85241,7 +85241,7 @@ class THistPainter extends ObjectPainter {
8524185241 }
8524285242
8524385243 if (!enabled) {
85244- if (pal_painter) {
85244+ if (pal_painter && !this.options.Same ) {
8524585245 this.options.Zvert = pal_painter._palette_vertical;
8524685246 pal_painter.Enabled = false;
8524785247 pal_painter.removeG(); // completely remove drawing without need to redraw complete pad
@@ -160437,30 +160437,29 @@ let THStackPainter$2 = class THStackPainter extends ObjectPainter {
160437160437
160438160438 /** @summary Decode draw options of THStack painter */
160439160439 decodeOptions(opt) {
160440- if (!this.options) this.options = {};
160440+ if (!this.options)
160441+ this.options = {};
160441160442 Object.assign(this.options, { ndim: 1, nostack: false, same: false, horder: true, has_errors: false, draw_errors: false, hopt: '', auto: '' });
160442160443
160443160444 const stack = this.getObject(),
160444- hist = stack.fHistogram || (stack.fHists ? stack.fHists.arr[0] : null) || (this.fStack ? this.fStack.arr[0] : null),
160445-
160446- hasErrors = hist2 => {
160447- const len = hist2.fSumw2?.length ?? 0;
160448- for (let n = 0; n < len; ++n) {
160449- if (hist2.fSumw2[n] > 0)
160450- return true;
160451- }
160452- return false;
160453- };
160445+ hist = stack.fHistogram || (stack.fHists ? stack.fHists.arr[0] : null) || (this.fStack ? this.fStack.arr[0] : null);
160454160446
160455160447 if (hist?._typename.indexOf(clTH2) === 0)
160456160448 this.options.ndim = 2;
160457160449
160458160450 if ((this.options.ndim === 2) && !opt)
160459160451 opt = 'lego1';
160460160452
160461- if (stack.fHists && !this.options.nostack) {
160462- for (let k = 0; k < stack.fHists.arr.length; ++k)
160463- this.options.has_errors = this.options.has_errors || hasErrors(stack.fHists.arr[k]);
160453+ if (!this.options.nostack) {
160454+ stack.fHists?.arr.forEach(h => {
160455+ const len = h.fSumw2?.length ?? 0;
160456+ for (let n = 0; n < len; ++n) {
160457+ if (h.fSumw2[n] > 0) {
160458+ this.options.has_errors = true;
160459+ break;
160460+ }
160461+ }
160462+ });
160464160463 }
160465160464
160466160465 this.options.nhist = stack.fHists?.arr?.length ?? 1;
0 commit comments