From f252a1b19a7f685a39423677bd4542834168ab65 Mon Sep 17 00:00:00 2001 From: Sergey Linev Date: Mon, 17 Jun 2024 13:07:26 +0200 Subject: [PATCH] Fix - ignore scatter palette in hist painter After drawing palette was disabled while no axisz option configured for the histogram --- modules/hist2d/THistPainter.mjs | 10 +++++++++- modules/hist2d/TScatterPainter.mjs | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/modules/hist2d/THistPainter.mjs b/modules/hist2d/THistPainter.mjs index 8626acb72..df1033b3a 100644 --- a/modules/hist2d/THistPainter.mjs +++ b/modules/hist2d/THistPainter.mjs @@ -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; } @@ -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 @@ -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(); diff --git a/modules/hist2d/TScatterPainter.mjs b/modules/hist2d/TScatterPainter.mjs index 156194237..abb33ecfb 100644 --- a/modules/hist2d/TScatterPainter.mjs +++ b/modules/hist2d/TScatterPainter.mjs @@ -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