Skip to content

Commit 501e130

Browse files
committed
minimal merge
1 parent 4cf8fee commit 501e130

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

scripts/JSRootPainter.more.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3171,7 +3171,7 @@
31713171
this.DrawNextFunction.bind(this, indx+1, callback));
31723172
}
31733173

3174-
TMultiGraphPainter.prototype.DrawNextGraph = function(indx, opt, subp) {
3174+
TMultiGraphPainter.prototype.DrawNextGraph = function(indx, opt, subp, used_timeout) {
31753175
if (subp) this.painters.push(subp);
31763176

31773177
var graphs = this.GetObject().fGraphs;
@@ -3182,6 +3182,10 @@
31823182
return this.DrawNextFunction(0, this.DrawingReady.bind(this));
31833183
}
31843184

3185+
// when too many graphs are drawn, avoid deep stack with timeout
3186+
if ((indx % 500 === 499) && !used_timeout)
3187+
return setTimeout(this.DrawNextGraph.bind(this,indx,opt,null,true),0);
3188+
31853189
// if there is auto colors assignment, try to provide it
31863190
if (this._pfc || this._plc || this._pmc) {
31873191
if (!this.pallette && JSROOT.Painter.GetColorPalette)

0 commit comments

Comments
 (0)