Skip to content

Commit

Permalink
Fix - properly handle functions update in TScatter
Browse files Browse the repository at this point in the history
One need to provide proper access to fFunctions
  • Loading branch information
linev committed Jun 18, 2024
1 parent 8783f46 commit b9059b3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
8 changes: 5 additions & 3 deletions modules/hist2d/TGraphPainter.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1396,7 +1396,7 @@ class TGraphPainter extends ObjectPainter {
return false;
}

/** @summary Update object members
/** @summary Update TGraph object members
* @private */
_updateMembers(graph, obj) {
graph.fBits = obj.fBits;
Expand All @@ -1423,6 +1423,8 @@ class TGraphPainter extends ObjectPainter {
graph.fMarkerColor = obj.fMarkerColor;
graph.fMarkerSize = obj.fMarkerSize;
graph.fMarkerStyle = obj.fMarkerStyle;

return obj.fFunctions;
}

/** @summary Update TGraph object */
Expand All @@ -1432,7 +1434,7 @@ class TGraphPainter extends ObjectPainter {
if (opt && (opt !== this.options.original))
this.decodeOptions(opt);

this._updateMembers(this.getObject(), obj);
const new_funcs = this._updateMembers(this.getObject(), obj);

this.createBins();

Expand All @@ -1448,7 +1450,7 @@ class TGraphPainter extends ObjectPainter {
}
}

this._funcHandler = new FunctionsHandler(this, this.getPadPainter(), obj.fFunctions);
this._funcHandler = new FunctionsHandler(this, this.getPadPainter(), new_funcs);

return true;
}
Expand Down
5 changes: 3 additions & 2 deletions modules/hist2d/TScatterPainter.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ class TScatterPainter extends TGraphPainter {
return pal;
}

/** @summary Update TScatter members */
/** @summary Update TScatter members
* @private */
_updateMembers(scatter, obj) {
scatter.fBits = obj.fBits;
scatter.fTitle = obj.fTitle;
Expand All @@ -55,7 +56,7 @@ class TScatterPainter extends TGraphPainter {
scatter.fMargin = obj.fMargin;
scatter.fMinMarkerSize = obj.fMinMarkerSize;
scatter.fMaxMarkerSize = obj.fMaxMarkerSize;
super._updateMembers(scatter.fGraph, obj.fGraph);
return super._updateMembers(scatter.fGraph, obj.fGraph);
}

/** @summary Return Z axis used for palette drawing
Expand Down

0 comments on commit b9059b3

Please sign in to comment.