Skip to content

Commit e531441

Browse files
committed
[jsroot] dev 13/01/2025
1. Support custom `settings` with RWebWindow 2. Use SetBit method - in most cases with TAxis zooming
1 parent bafd297 commit e531441

File tree

12 files changed

+122
-119
lines changed

12 files changed

+122
-119
lines changed

js/build/jsroot.js

Lines changed: 57 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -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

js/modules/core.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const version_id = 'dev',
44

55
/** @summary version date
66
* @desc Release date in format day/month/year like '14/04/2022' */
7-
version_date = '9/01/2025',
7+
version_date = '13/01/2025',
88

99
/** @summary version id and date
1010
* @desc Produced by concatenation of {@link version_id} and {@link version_date}

js/modules/gpad/TAxisPainter.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -900,8 +900,8 @@ class TAxisPainter extends ObjectPainter {
900900

901901
const axis = this.getObject(), axis2 = this.source_axis,
902902
setBit = (bit, on) => {
903-
if (axis && axis.TestBit(bit) !== on) axis.InvertBit(bit);
904-
if (axis2 && axis2.TestBit(bit) !== on) axis2.InvertBit(bit);
903+
axis?.SetBit(bit, on);
904+
axis2?.SetBit(bit, on);
905905
};
906906

907907
this.titleOffset = (vertical ? new_x : new_y) / offset_k;

js/modules/gpad/TCanvasPainter.mjs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -808,9 +808,7 @@ class TCanvasPainter extends TPadPainter {
808808
axes.push({ axis, f: axis.fFirst, l: axis.fLast, b: axis.fBits });
809809
axis.fFirst = main.getSelectIndex(name, 'left', 1);
810810
axis.fLast = main.getSelectIndex(name, 'right');
811-
const has_range = (axis.fFirst > 0) || (axis.fLast < axis.fNbins);
812-
if (has_range !== axis.TestBit(EAxisBits.kAxisRange))
813-
axis.InvertBit(EAxisBits.kAxisRange);
811+
axis.SetBit(EAxisBits.kAxisRange, (axis.fFirst > 0) || (axis.fLast < axis.fNbins));
814812
}
815813
};
816814

js/modules/gpad/TFramePainter.mjs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1865,8 +1865,9 @@ class TFramePainter extends ObjectPainter {
18651865
this[`zoom_${name}min`] = axis.fFirst > 1 ? axis.GetBinLowEdge(axis.fFirst) : axis.fXmin;
18661866
this[`zoom_${name}max`] = axis.fLast < axis.fNbins ? axis.GetBinLowEdge(axis.fLast + 1) : axis.fXmax;
18671867
// reset user range for main painter
1868-
axis.InvertBit(EAxisBits.kAxisRange);
1869-
axis.fFirst = 1; axis.fLast = axis.fNbins;
1868+
axis.SetBit(EAxisBits.kAxisRange, false);
1869+
axis.fFirst = 1;
1870+
axis.fLast = axis.fNbins;
18701871
}
18711872
}
18721873
}
@@ -2656,8 +2657,7 @@ class TFramePainter extends ObjectPainter {
26562657
flag = true;
26572658
} else
26582659
faxis.fLast = faxis.fNbins;
2659-
if (flag !== faxis.TestBit(EAxisBits.kAxisRange))
2660-
faxis.InvertBit(EAxisBits.kAxisRange);
2660+
faxis.SetBit(EAxisBits.kAxisRange, flag);
26612661
hist_painter?.scanContent();
26622662
this.zoomSingle(kind, arr[0], arr[1], true).then(res => {
26632663
if (!res && flag)
@@ -2707,15 +2707,14 @@ class TFramePainter extends ObjectPainter {
27072707
menu.endsub();
27082708
}
27092709
menu.addchk(faxis.TestBit(EAxisBits.kMoreLogLabels), 'More log', flag => {
2710-
faxis.InvertBit(EAxisBits.kMoreLogLabels);
2710+
faxis.SetBit(EAxisBits.kMoreLogLabels, flag);
27112711
if (hist_painter?.snapid && (kind.length === 1))
27122712
hist_painter.interactiveRedraw('pad', `exec:SetMoreLogLabels(${flag})`, kind);
27132713
else
27142714
this.interactiveRedraw('pad');
27152715
});
27162716
menu.addchk(handle?.noexp ?? faxis.TestBit(EAxisBits.kNoExponent), 'No exponent', flag => {
2717-
if (flag !== faxis.TestBit(EAxisBits.kNoExponent))
2718-
faxis.InvertBit(EAxisBits.kNoExponent);
2717+
faxis.SetBit(EAxisBits.kNoExponent, flag);
27192718
if (handle) handle.noexp_changed = true;
27202719
this[`${kind}_noexp_changed`] = true;
27212720
if (hist_painter?.snapid && (kind.length === 1))

js/modules/gpad/TPadPainter.mjs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,8 @@ class TPadPainter extends ObjectPainter {
585585
/** @summary Set grayscale mode for the canvas
586586
* @private */
587587
setGrayscale(flag) {
588-
if (!this.iscan) return;
588+
if (!this.iscan)
589+
return;
589590

590591
let changed = false;
591592

@@ -2567,8 +2568,8 @@ class TPadPainter extends ObjectPainter {
25672568

25682569
if (d.check('NOZOOMX')) this.options.NoZoomX = true;
25692570
if (d.check('NOZOOMY')) this.options.NoZoomY = true;
2570-
if (d.check('GRAYSCALE') && !pad.TestBit(kIsGrayscale))
2571-
pad.InvertBit(kIsGrayscale);
2571+
if (d.check('GRAYSCALE'))
2572+
pad.SetBit(kIsGrayscale, true);
25722573

25732574
function forEach(func, p) {
25742575
if (!p) p = pad;

js/modules/gui/menu.mjs

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -708,9 +708,9 @@ class JSRootMenu {
708708

709709
this.sub('Labels');
710710
this.addchk(faxis.TestBit(EAxisBits.kCenterLabels), 'Center',
711-
arg => { faxis.InvertBit(EAxisBits.kCenterLabels); painter.interactiveRedraw('pad', `exec:CenterLabels(${arg})`, kind); });
711+
arg => { faxis.SetBit(EAxisBits.kCenterLabels, arg); painter.interactiveRedraw('pad', `exec:CenterLabels(${arg})`, kind); });
712712
this.addchk(faxis.TestBit(EAxisBits.kLabelsVert), 'Rotate',
713-
arg => { faxis.InvertBit(EAxisBits.kLabelsVert); painter.interactiveRedraw('pad', `exec:SetBit(TAxis::kLabelsVert,${arg})`, kind); });
713+
arg => { faxis.SetBit(EAxisBits.kLabelsVert, arg); painter.interactiveRedraw('pad', `exec:SetBit(TAxis::kLabelsVert,${arg})`, kind); });
714714
this.addColorMenu('Color', faxis.fLabelColor,
715715
arg => { faxis.fLabelColor = arg; painter.interactiveRedraw('pad', getColorExec(arg, 'SetLabelColor'), kind); });
716716
this.addSizeMenu('Offset', -0.02, 0.1, 0.01, faxis.fLabelOffset,
@@ -746,20 +746,21 @@ class JSRootMenu {
746746
});
747747
});
748748
this.addchk(faxis.TestBit(EAxisBits.kCenterTitle), 'Center',
749-
arg => { faxis.InvertBit(EAxisBits.kCenterTitle); painter.interactiveRedraw('pad', `exec:CenterTitle(${arg})`, kind); });
749+
arg => { faxis.SetBit(EAxisBits.kCenterTitle, arg); painter.interactiveRedraw('pad', `exec:CenterTitle(${arg})`, kind); });
750750
if (!painter?.snapid) {
751751
this.addchk(faxis.TestBit(EAxisBits.kOppositeTitle), 'Opposite',
752-
() => { faxis.InvertBit(EAxisBits.kOppositeTitle); painter.redrawPad(); });
752+
arg => { faxis.SetBit(EAxisBits.kOppositeTitle, arg); painter.redrawPad(); });
753753
}
754754
this.addchk(faxis.TestBit(EAxisBits.kRotateTitle), 'Rotate',
755-
arg => { faxis.InvertBit(EAxisBits.kRotateTitle); painter.interactiveRedraw('pad', is_gaxis ? `exec:SetBit(TAxis::kRotateTitle, ${arg})` : `exec:RotateTitle(${arg})`, kind); });
756-
if (is_gaxis) {
757-
this.addColorMenu('Color', faxis.fTextColor,
758-
arg => { faxis.fTextColor = arg; painter.interactiveRedraw('pad', getColorExec(arg, 'SetTitleColor'), kind); });
759-
} else {
760-
this.addColorMenu('Color', faxis.fTitleColor,
761-
arg => { faxis.fTitleColor = arg; painter.interactiveRedraw('pad', getColorExec(arg, 'SetTitleColor'), kind); });
762-
}
755+
arg => { faxis.SetBit(EAxisBits.kRotateTitle, arg); painter.interactiveRedraw('pad', is_gaxis ? `exec:SetBit(TAxis::kRotateTitle, ${arg})` : `exec:RotateTitle(${arg})`, kind); });
756+
this.addColorMenu('Color', is_gaxis ? faxis.fTextColor : faxis.fTitleColor, arg => {
757+
if (is_gaxis)
758+
faxis.fTextColor = arg;
759+
else
760+
faxis.fTitleColor = arg;
761+
762+
painter.interactiveRedraw('pad', getColorExec(arg, 'SetTitleColor'), kind);
763+
});
763764
this.addSizeMenu('Offset', 0, 3, 0.2, faxis.fTitleOffset,
764765
arg => { faxis.fTitleOffset = arg; painter.interactiveRedraw('pad', `exec:SetTitleOffset(${arg})`, kind); });
765766
a = faxis.fTitleSize >= 1;

0 commit comments

Comments
 (0)