Skip to content

Commit ec6ac86

Browse files
committed
Use canvas method to report 3D drawing problems
1 parent 743ee47 commit ec6ac86

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

modules/hist2d/TH1Painter.mjs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,8 +1332,12 @@ class TH1Painter extends THistPainter {
13321332
if (!this.options.Mode3D)
13331333
return this.draw2D(reason);
13341334

1335-
return this.draw3D(reason).catch(() => {
1336-
console.error('Fail to draw histogram in 3D - back to 2D')
1335+
return this.draw3D(reason).catch(err => {
1336+
const cp = this.getCanvPainter();
1337+
if (isFunc(cp?.showConsoleError))
1338+
cp.showConsoleError(err);
1339+
else
1340+
console.error('Fail to draw histogram in 3D - back to 2D');
13371341
this.options.Mode3D = false;
13381342
return this.draw2D(reason);
13391343
});

modules/hist2d/TH2Painter.mjs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3548,8 +3548,12 @@ class TH2Painter extends THistPainter {
35483548
if (!this.options.Mode3D)
35493549
return this.draw2D(reason);
35503550

3551-
return this.draw3D(reason).catch(() => {
3552-
console.error('Fail to draw histogram in 3D - back to 2D')
3551+
return this.draw3D(reason).catch(err => {
3552+
const cp = this.getCanvPainter();
3553+
if (isFunc(cp?.showConsoleError))
3554+
cp.showConsoleError(err);
3555+
else
3556+
console.error('Fail to draw histogram in 3D - back to 2D');
35533557
this.options.Mode3D = false;
35543558
return this.draw2D(reason);
35553559
});

0 commit comments

Comments
 (0)