Skip to content

Commit d3c2d17

Browse files
committed
Fix - do not generate TCanvas JSON with fFillStyle=0
Such fill style screw up ROOT C++ after reading from JSON
1 parent 9567762 commit d3c2d17

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

scripts/JSRootPainter.v6.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4548,7 +4548,10 @@
45484548
/// produce JSON for TCanvas, which can be used to display canvas once again
45494549
TCanvasPainter.prototype.ProduceJSON = function() {
45504550

4551-
var canv = this.GetObject();
4551+
var canv = this.GetObject(),
4552+
fill0 = (canv.fFillStyle == 0);
4553+
4554+
if (fill0) canv.fFillStyle = 1001;
45524555

45534556
if (!this.normal_canvas) {
45544557

@@ -4564,6 +4567,8 @@
45644567

45654568
var res = JSROOT.toJSON(canv);
45664569

4570+
if (fill0) canv.fFillStyle = 0;
4571+
45674572
if (!this.normal_canvas)
45684573
canv.fPrimitives.Clear();
45694574

0 commit comments

Comments
 (0)