Skip to content

Commit 30df466

Browse files
committed
Fix - verify that TH1/TH2 superimposing in 3D works properly
If first histogram (which defines axes and 3D mode) drawn in 2D, of course second histograms cannot be drawn in 3D. Provide simple check to prevent civiar errors
1 parent ead0468 commit 30df466

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

scripts/JSRootPainter.hist3d.js

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1523,13 +1523,12 @@
15231523
main.DrawXYZ(main.toplevel, { use_y_for_z: true, zmult: 1.1, zoom: JSROOT.gStyle.Zooming, ndim: 1 });
15241524
}
15251525

1526-
this.Draw3DBins();
1527-
1528-
main.Render3D();
1529-
1530-
this.UpdateStatWebCanvas();
1531-
1532-
main.AddKeysHandler();
1526+
if (main.mode3d) {
1527+
this.Draw3DBins();
1528+
main.Render3D();
1529+
this.UpdateStatWebCanvas();
1530+
main.AddKeysHandler();
1531+
}
15331532
}
15341533

15351534
if (is_main) {
@@ -1580,13 +1579,12 @@
15801579
main.DrawXYZ(main.toplevel, { zmult: zmult, zoom: JSROOT.gStyle.Zooming, ndim: 2 });
15811580
}
15821581

1583-
this.Draw3DBins();
1584-
1585-
main.Render3D();
1586-
1587-
this.UpdateStatWebCanvas();
1588-
1589-
main.AddKeysHandler();
1582+
if (main.mode3d) {
1583+
this.Draw3DBins();
1584+
main.Render3D();
1585+
this.UpdateStatWebCanvas();
1586+
main.AddKeysHandler();
1587+
}
15901588
}
15911589

15921590
if (is_main) {

0 commit comments

Comments
 (0)