Skip to content

Commit

Permalink
Fix - ignore scatter palette in hist painter
Browse files Browse the repository at this point in the history
After drawing palette was disabled while no axisz option
configured for the histogram
  • Loading branch information
linev committed Jun 17, 2024
1 parent 6168256 commit f252a1b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion modules/hist2d/THistPainter.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ class THistDrawOptions {
Render3D: constants.Render3D.Default,
FrontBox: true, BackBox: true,
need_fillcol: false,
minimum: kNoZoom, maximum: kNoZoom, ymin: 0, ymax: 0, cutg: null, IgnoreMainScale: false });
minimum: kNoZoom, maximum: kNoZoom, ymin: 0, ymax: 0, cutg: null,
IgnoreMainScale: false, IgnorePalette: false });
}

isCartesian() { return this.System === kCARTESIAN; }
Expand Down Expand Up @@ -106,6 +107,9 @@ class THistDrawOptions {
d.check('USE_PAD_PALETTE');
d.check('USE_PAD_STATS');

if (d.check('IGNORE_PALETTE'))
this.IgnorePalette = true;

if (d.check('PAL', true))
this.Palette = d.partAsInt();
// this is zooming of histo content
Expand Down Expand Up @@ -2010,6 +2014,10 @@ class THistPainter extends ObjectPainter {
/** @summary draw color palette
* @return {Promise} when done */
async drawColorPalette(enabled, postpone_draw, can_move) {
// in special cases like scatter palette drawing is ignored
if (this.options.IgnorePalette)
return null;

// only when create new palette, one could change frame size
const mp = this.getMainPainter(),
pp = this.getPadPainter();
Expand Down
2 changes: 1 addition & 1 deletion modules/hist2d/TScatterPainter.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class TScatterPainter extends TGraphPainter {
* @private */
async drawAxisHisto() {
const histo = this.createHistogram();
return TH2Painter.draw(this.getDom(), histo, this.options.Axis);
return TH2Painter.draw(this.getDom(), histo, this.options.Axis + ';IGNORE_PALETTE');
}

/** @summary Provide palette, create if necessary
Expand Down

0 comments on commit f252a1b

Please sign in to comment.