Skip to content

Commit 3859f7f

Browse files
committed
Build with canvas 3D error fix
1 parent fc01eb2 commit 3859f7f

File tree

2 files changed

+39
-17
lines changed

2 files changed

+39
-17
lines changed

build/jsroot.js

Lines changed: 38 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const version_id = 'dev',
1212

1313
/** @summary version date
1414
* @desc Release date in format day/month/year like '14/04/2022' */
15-
version_date = '16/05/2025',
15+
version_date = '19/05/2025',
1616

1717
/** @summary version id and date
1818
* @desc Produced by concatenation of {@link version_id} and {@link version_date}
@@ -96813,10 +96813,21 @@ let TH2Painter$2 = class TH2Painter extends THistPainter {
9681396813
const main = this.getMainPainter(),
9681496814
fp = this.getFramePainter();
9681596815

96816-
if ((main !== this) && fp && (fp.mode3d !== this.options.Mode3D))
96817-
this.copyOptionsFrom(main);
96816+
if ((main !== this) && fp && (fp.mode3d !== this.options.Mode3D))
96817+
this.copyOptionsFrom(main);
9681896818

96819-
return this.options.Mode3D ? this.draw3D(reason) : this.draw2D(reason);
96819+
if (!this.options.Mode3D)
96820+
return this.draw2D(reason);
96821+
96822+
return this.draw3D(reason).catch(err => {
96823+
const cp = this.getCanvPainter();
96824+
if (isFunc(cp?.showConsoleError))
96825+
cp.showConsoleError(err);
96826+
else
96827+
console.error('Fail to draw histogram in 3D - back to 2D');
96828+
this.options.Mode3D = false;
96829+
return this.draw2D(reason);
96830+
});
9682096831
}
9682196832

9682296833
/** @summary Redraw histogram */
@@ -100622,17 +100633,6 @@ let TH1Painter$2 = class TH1Painter extends THistPainter {
100622100633
return false;
100623100634
}
100624100635

100625-
/** @summary Call drawing function depending from 3D mode */
100626-
async callDrawFunc(reason) {
100627-
const main = this.getMainPainter(),
100628-
fp = this.getFramePainter();
100629-
100630-
if ((main !== this) && fp && (fp.mode3d !== this.options.Mode3D))
100631-
this.copyOptionsFrom(main);
100632-
100633-
return this.options.Mode3D ? this.draw3D(reason) : this.draw2D(reason);
100634-
}
100635-
100636100636
/** @summary Performs 2D drawing of histogram
100637100637
* @return {Promise} when ready */
100638100638
async draw2D(reason) {
@@ -100660,6 +100660,28 @@ let TH1Painter$2 = class TH1Painter extends THistPainter {
100660100660
return this.draw2D(reason);
100661100661
}
100662100662

100663+
/** @summary Call drawing function depending from 3D mode */
100664+
async callDrawFunc(reason) {
100665+
const main = this.getMainPainter(),
100666+
fp = this.getFramePainter();
100667+
100668+
if ((main !== this) && fp && (fp.mode3d !== this.options.Mode3D))
100669+
this.copyOptionsFrom(main);
100670+
100671+
if (!this.options.Mode3D)
100672+
return this.draw2D(reason);
100673+
100674+
return this.draw3D(reason).catch(err => {
100675+
const cp = this.getCanvPainter();
100676+
if (isFunc(cp?.showConsoleError))
100677+
cp.showConsoleError(err);
100678+
else
100679+
console.error('Fail to draw histogram in 3D - back to 2D');
100680+
this.options.Mode3D = false;
100681+
return this.draw2D(reason);
100682+
});
100683+
}
100684+
100663100685
/** @summary Redraw histogram */
100664100686
redraw(reason) {
100665100687
return this.callDrawFunc(reason);
@@ -100678,7 +100700,7 @@ let TH1Painter$2 = class TH1Painter extends THistPainter {
100678100700
class TH1Painter extends TH1Painter$2 {
100679100701

100680100702
/** @summary draw TH1 object in 3D mode */
100681-
draw3D(reason) {
100703+
async draw3D(reason) {
100682100704
this.mode3d = true;
100683100705

100684100706
const fp = this.getFramePainter(), // who makes axis drawing

modules/core.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const version_id = 'dev',
44

55
/** @summary version date
66
* @desc Release date in format day/month/year like '14/04/2022' */
7-
version_date = '16/05/2025',
7+
version_date = '19/05/2025',
88

99
/** @summary version id and date
1010
* @desc Produced by concatenation of {@link version_id} and {@link version_date}

0 commit comments

Comments
 (0)