@@ -12,7 +12,7 @@ const version_id = 'dev',
1212
1313/** @summary version date
1414 * @desc Release date in format day/month/year like '14/04/2022' */
15- version_date = '9 /01/2025',
15+ version_date = '13 /01/2025',
1616
1717/** @summary version id and date
1818 * @desc Produced by concatenation of {@link version_id} and {@link version_date}
@@ -61563,9 +61563,9 @@ class JSRootMenu {
6156361563
6156461564 this.sub('Labels');
6156561565 this.addchk(faxis.TestBit(EAxisBits.kCenterLabels), 'Center',
61566- arg => { faxis.InvertBit (EAxisBits.kCenterLabels); painter.interactiveRedraw('pad', `exec:CenterLabels(${arg})`, kind); });
61566+ arg => { faxis.SetBit (EAxisBits.kCenterLabels, arg ); painter.interactiveRedraw('pad', `exec:CenterLabels(${arg})`, kind); });
6156761567 this.addchk(faxis.TestBit(EAxisBits.kLabelsVert), 'Rotate',
61568- arg => { faxis.InvertBit (EAxisBits.kLabelsVert); painter.interactiveRedraw('pad', `exec:SetBit(TAxis::kLabelsVert,${arg})`, kind); });
61568+ arg => { faxis.SetBit (EAxisBits.kLabelsVert, arg ); painter.interactiveRedraw('pad', `exec:SetBit(TAxis::kLabelsVert,${arg})`, kind); });
6156961569 this.addColorMenu('Color', faxis.fLabelColor,
6157061570 arg => { faxis.fLabelColor = arg; painter.interactiveRedraw('pad', getColorExec(arg, 'SetLabelColor'), kind); });
6157161571 this.addSizeMenu('Offset', -0.02, 0.1, 0.01, faxis.fLabelOffset,
@@ -61601,20 +61601,21 @@ class JSRootMenu {
6160161601 });
6160261602 });
6160361603 this.addchk(faxis.TestBit(EAxisBits.kCenterTitle), 'Center',
61604- arg => { faxis.InvertBit (EAxisBits.kCenterTitle); painter.interactiveRedraw('pad', `exec:CenterTitle(${arg})`, kind); });
61604+ arg => { faxis.SetBit (EAxisBits.kCenterTitle, arg ); painter.interactiveRedraw('pad', `exec:CenterTitle(${arg})`, kind); });
6160561605 if (!painter?.snapid) {
6160661606 this.addchk(faxis.TestBit(EAxisBits.kOppositeTitle), 'Opposite',
61607- () => { faxis.InvertBit (EAxisBits.kOppositeTitle); painter.redrawPad(); });
61607+ arg => { faxis.SetBit (EAxisBits.kOppositeTitle, arg ); painter.redrawPad(); });
6160861608 }
6160961609 this.addchk(faxis.TestBit(EAxisBits.kRotateTitle), 'Rotate',
61610- arg => { faxis.InvertBit(EAxisBits.kRotateTitle); painter.interactiveRedraw('pad', is_gaxis ? `exec:SetBit(TAxis::kRotateTitle, ${arg})` : `exec:RotateTitle(${arg})`, kind); });
61611- if (is_gaxis) {
61612- this.addColorMenu('Color', faxis.fTextColor,
61613- arg => { faxis.fTextColor = arg; painter.interactiveRedraw('pad', getColorExec(arg, 'SetTitleColor'), kind); });
61614- } else {
61615- this.addColorMenu('Color', faxis.fTitleColor,
61616- arg => { faxis.fTitleColor = arg; painter.interactiveRedraw('pad', getColorExec(arg, 'SetTitleColor'), kind); });
61617- }
61610+ arg => { faxis.SetBit(EAxisBits.kRotateTitle, arg); painter.interactiveRedraw('pad', is_gaxis ? `exec:SetBit(TAxis::kRotateTitle, ${arg})` : `exec:RotateTitle(${arg})`, kind); });
61611+ this.addColorMenu('Color', is_gaxis ? faxis.fTextColor : faxis.fTitleColor, arg => {
61612+ if (is_gaxis)
61613+ faxis.fTextColor = arg;
61614+ else
61615+ faxis.fTitleColor = arg;
61616+
61617+ painter.interactiveRedraw('pad', getColorExec(arg, 'SetTitleColor'), kind);
61618+ });
6161861619 this.addSizeMenu('Offset', 0, 3, 0.2, faxis.fTitleOffset,
6161961620 arg => { faxis.fTitleOffset = arg; painter.interactiveRedraw('pad', `exec:SetTitleOffset(${arg})`, kind); });
6162061621 a = faxis.fTitleSize >= 1;
@@ -63423,8 +63424,8 @@ class TAxisPainter extends ObjectPainter {
6342363424
6342463425 const axis = this.getObject(), axis2 = this.source_axis,
6342563426 setBit = (bit, on) => {
63426- if ( axis && axis.TestBit (bit) !== on) axis.InvertBit(bit );
63427- if ( axis2 && axis2.TestBit (bit) !== on) axis2.InvertBit(bit );
63427+ axis?.SetBit (bit, on );
63428+ axis2?.SetBit (bit, on );
6342863429 };
6342963430
6343063431 this.titleOffset = (vertical ? new_x : new_y) / offset_k;
@@ -65827,8 +65828,9 @@ class TFramePainter extends ObjectPainter {
6582765828 this[`zoom_${name}min`] = axis.fFirst > 1 ? axis.GetBinLowEdge(axis.fFirst) : axis.fXmin;
6582865829 this[`zoom_${name}max`] = axis.fLast < axis.fNbins ? axis.GetBinLowEdge(axis.fLast + 1) : axis.fXmax;
6582965830 // reset user range for main painter
65830- axis.InvertBit(EAxisBits.kAxisRange);
65831- axis.fFirst = 1; axis.fLast = axis.fNbins;
65831+ axis.SetBit(EAxisBits.kAxisRange, false);
65832+ axis.fFirst = 1;
65833+ axis.fLast = axis.fNbins;
6583265834 }
6583365835 }
6583465836 }
@@ -66618,8 +66620,7 @@ class TFramePainter extends ObjectPainter {
6661866620 flag = true;
6661966621 } else
6662066622 faxis.fLast = faxis.fNbins;
66621- if (flag !== faxis.TestBit(EAxisBits.kAxisRange))
66622- faxis.InvertBit(EAxisBits.kAxisRange);
66623+ faxis.SetBit(EAxisBits.kAxisRange, flag);
6662366624 hist_painter?.scanContent();
6662466625 this.zoomSingle(kind, arr[0], arr[1], true).then(res => {
6662566626 if (!res && flag)
@@ -66669,15 +66670,14 @@ class TFramePainter extends ObjectPainter {
6666966670 menu.endsub();
6667066671 }
6667166672 menu.addchk(faxis.TestBit(EAxisBits.kMoreLogLabels), 'More log', flag => {
66672- faxis.InvertBit (EAxisBits.kMoreLogLabels);
66673+ faxis.SetBit (EAxisBits.kMoreLogLabels, flag );
6667366674 if (hist_painter?.snapid && (kind.length === 1))
6667466675 hist_painter.interactiveRedraw('pad', `exec:SetMoreLogLabels(${flag})`, kind);
6667566676 else
6667666677 this.interactiveRedraw('pad');
6667766678 });
6667866679 menu.addchk(handle?.noexp ?? faxis.TestBit(EAxisBits.kNoExponent), 'No exponent', flag => {
66679- if (flag !== faxis.TestBit(EAxisBits.kNoExponent))
66680- faxis.InvertBit(EAxisBits.kNoExponent);
66680+ faxis.SetBit(EAxisBits.kNoExponent, flag);
6668166681 if (handle) handle.noexp_changed = true;
6668266682 this[`${kind}_noexp_changed`] = true;
6668366683 if (hist_painter?.snapid && (kind.length === 1))
@@ -69474,7 +69474,8 @@ class TPadPainter extends ObjectPainter {
6947469474 /** @summary Set grayscale mode for the canvas
6947569475 * @private */
6947669476 setGrayscale(flag) {
69477- if (!this.iscan) return;
69477+ if (!this.iscan)
69478+ return;
6947869479
6947969480 let changed = false;
6948069481
@@ -71456,8 +71457,8 @@ class TPadPainter extends ObjectPainter {
7145671457
7145771458 if (d.check('NOZOOMX')) this.options.NoZoomX = true;
7145871459 if (d.check('NOZOOMY')) this.options.NoZoomY = true;
71459- if (d.check('GRAYSCALE') && !pad.TestBit(kIsGrayscale) )
71460- pad.InvertBit (kIsGrayscale);
71460+ if (d.check('GRAYSCALE'))
71461+ pad.SetBit (kIsGrayscale, true );
7146171462
7146271463 function forEach(func, p) {
7146371464 if (!p) p = pad;
@@ -72335,9 +72336,7 @@ class TCanvasPainter extends TPadPainter {
7233572336 axes.push({ axis, f: axis.fFirst, l: axis.fLast, b: axis.fBits });
7233672337 axis.fFirst = main.getSelectIndex(name, 'left', 1);
7233772338 axis.fLast = main.getSelectIndex(name, 'right');
72338- const has_range = (axis.fFirst > 0) || (axis.fLast < axis.fNbins);
72339- if (has_range !== axis.TestBit(EAxisBits.kAxisRange))
72340- axis.InvertBit(EAxisBits.kAxisRange);
72339+ axis.SetBit(EAxisBits.kAxisRange, (axis.fFirst > 0) || (axis.fLast < axis.fNbins));
7234172340 }
7234272341 };
7234372342
@@ -74664,11 +74663,12 @@ class THistDrawOptions {
7466474663 if ((axis === 'fZaxis') && (hdim < 3) && !this.Lego && !this.Surf)
7466574664 return;
7466674665 let flag = d.check(opt);
74667- if (pad && pad['$'+opt]) { flag = true; pad['$'+opt] = undefined; }
74668- if (flag && histo) {
74669- if (!histo[axis].TestBit(bit))
74670- histo[axis].InvertBit(bit);
74666+ if (pad && pad['$'+opt]) {
74667+ flag = true;
74668+ pad['$'+opt] = undefined;
7467174669 }
74670+ if (flag && histo)
74671+ histo[axis].SetBit(bit, true);
7467274672 };
7467374673
7467474674 check_axis_bit('OTX', 'fXaxis', EAxisBits.kOppositeTitle);
@@ -75338,13 +75338,13 @@ class THistPainter extends ObjectPainter {
7533875338
7533975339 // copy histogram bits
7534075340 if (histo.TestBit(kNoStats) !== obj.TestBit(kNoStats)) {
75341- histo.InvertBit (kNoStats);
75341+ histo.SetBit (kNoStats, obj.TestBit(kNoStats) );
7534275342 // here check only stats bit
75343- if (statpainter) statpainter.Enabled = !histo.TestBit(kNoStats) && !this.options.NoStat; // && (!this.options.Same || this.options.ForceStat)
75343+ if (statpainter)
75344+ statpainter.Enabled = !histo.TestBit(kNoStats) && !this.options.NoStat; // && (!this.options.Same || this.options.ForceStat)
7534475345 }
7534575346
75346- if (histo.TestBit(kIsZoomed$1) !== obj.TestBit(kIsZoomed$1))
75347- histo.InvertBit(kIsZoomed$1);
75347+ histo.SetBit(kIsZoomed$1, obj.TestBit(kIsZoomed$1));
7534875348
7534975349 // special treatment for web canvas - also name can be changed
7535075350 if (this.snapid !== undefined) {
@@ -75918,9 +75918,12 @@ class THistPainter extends ObjectPainter {
7591875918 let res = false;
7591975919
7592075920 const unzoomTAxis = obj => {
75921- if (!obj || !obj.TestBit(EAxisBits.kAxisRange)) return false;
75922- if (obj.fFirst === obj.fLast) return false;
75923- if ((obj.fFirst <= 1) && (obj.fLast >= obj.fNbins)) return false;
75921+ if (!obj || !obj.TestBit(EAxisBits.kAxisRange))
75922+ return false;
75923+ if (obj.fFirst === obj.fLast)
75924+ return false;
75925+ if ((obj.fFirst <= 1) && (obj.fLast >= obj.fNbins))
75926+ return false;
7592475927 obj.InvertBit(EAxisBits.kAxisRange);
7592575928 return true;
7592675929 },
@@ -75965,15 +75968,15 @@ class THistPainter extends ObjectPainter {
7596575968 menu.input(`Enter user range for axis ${arg} like [1,${taxis.fNbins}]`, curr).then(res => {
7596675969 if (!res) return;
7596775970 res = JSON.parse(res);
75968- if (!res || (res.length !== 2)) return;
75969- const first = parseInt(res[0]), last = parseInt(res[1]);
75970- if (!Number.isInteger(first) || !Number.isInteger(last)) return;
75971+ if (!res || (res.length !== 2))
75972+ return;
75973+ const first = parseInt(res[0]),
75974+ last = parseInt(res[1]);
75975+ if (!Number.isInteger(first) || !Number.isInteger(last))
75976+ return;
7597175977 taxis.fFirst = first;
7597275978 taxis.fLast = last;
75973-
75974- const newflag = (taxis.fFirst < taxis.fLast) && (taxis.fFirst >= 1) && (taxis.fLast <= taxis.fNbins);
75975- if (newflag !== taxis.TestBit(EAxisBits.kAxisRange))
75976- taxis.InvertBit(EAxisBits.kAxisRange);
75979+ taxis.SetBit(EAxisBits.kAxisRange, (taxis.fFirst < taxis.fLast) && (taxis.fFirst >= 1) && (taxis.fLast <= taxis.fNbins));
7597775980
7597875981 this.interactiveRedraw();
7597975982 });
@@ -77509,12 +77512,9 @@ let TH2Painter$2 = class TH2Painter extends THistPainter {
7750977512 }
7751077513
7751177514 if (first < last) {
77512- const axis = p.fXaxis;
77513- axis.fFirst = first;
77514- axis.fLast = last;
77515-
77516- if (((axis.fFirst === 1) && (axis.fLast === axis.fNbins)) === axis.TestBit(EAxisBits.kAxisRange))
77517- axis.InvertBit(EAxisBits.kAxisRange);
77515+ p.fXaxis.fFirst = first;
77516+ p.fXaxis.fLast = last;
77517+ p.fXaxis.SetBit(EAxisBits.kAxisRange, (first !== 1) || (last !== p.fXaxis.fNbins));
7751877518 }
7751977519
7752077520 // reset statistic before display
@@ -84344,8 +84344,7 @@ class TH3Painter extends THistPainter {
8434484344 this.draw_content = (this.gmaxbin !== 0) || (this.gminbin !== 0);
8434584345
8434684346 this.transferFunc = this.findFunction(clTF1, 'TransferFunction');
84347- if (this.transferFunc && !this.transferFunc.TestBit(BIT(9))) // TF1::kNotDraw
84348- this.transferFunc.InvertBit(BIT(9));
84347+ this.transferFunc?.SetBit(BIT(9), true); // TF1::kNotDraw
8434984348 }
8435084349
8435184350 /** @summary Count TH3 statistic */
@@ -149459,8 +149458,8 @@ let TGraphPainter$1 = class TGraphPainter extends ObjectPainter {
149459149458 testEditable(arg) {
149460149459 const obj = this.getGraph();
149461149460 if (!obj) return false;
149462- if ((arg === 'toggle') || (( arg !== undefined) && (!arg !== obj.TestBit(kNotEditable)) ))
149463- obj.InvertBit (kNotEditable);
149461+ if ((arg === 'toggle') || (arg !== undefined))
149462+ obj.SetBit (kNotEditable, !arg );
149464149463 return !obj.TestBit(kNotEditable);
149465149464 }
149466149465
@@ -149868,8 +149867,8 @@ let TGraphPainter$1 = class TGraphPainter extends ObjectPainter {
149868149867 painter.createBins();
149869149868 painter.createStat();
149870149869 const graph = painter.getGraph();
149871- if (!settings.DragGraphs && graph && !graph.TestBit(kNotEditable) )
149872- graph.InvertBit (kNotEditable);
149870+ if (!settings.DragGraphs)
149871+ graph?.SetBit (kNotEditable, true );
149873149872
149874149873 let promise = Promise.resolve();
149875149874
0 commit comments