Skip to content

Commit 4e860a1

Browse files
committed
Limit stack depth also when drawing histograms in THStack (#154)
1 parent 501e130 commit 4e860a1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

scripts/JSRootPainter.hist.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6325,7 +6325,7 @@
63256325
return res;
63266326
}
63276327

6328-
THStackPainter.prototype.DrawNextHisto = function(indx, opt, mm, subp) {
6328+
THStackPainter.prototype.DrawNextHisto = function(indx, opt, mm, subp, reenter) {
63296329
if (mm === "callback") {
63306330
mm = null; // just misuse min/max argument to indicate callback
63316331
if (indx<0) this.firstpainter = subp;
@@ -6343,6 +6343,9 @@
63436343
return this.DrawingReady();
63446344
}
63456345

6346+
if ((indx % 500 === 499) && !reenter)
6347+
return setTimeout(this.DrawNextHisto.bind(this, indx, opt, mm, subp, true), 0);
6348+
63466349
if (indx>=0) {
63476350
rindx = this.horder ? indx : nhists-indx-1;
63486351
hist = hlst.arr[rindx];

0 commit comments

Comments
 (0)