Skip to content

Commit

Permalink
Build with frame attributes items
Browse files Browse the repository at this point in the history
  • Loading branch information
linev committed Nov 29, 2024
1 parent 4f411a6 commit 3bd4c73
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
29 changes: 22 additions & 7 deletions build/jsroot.js
Original file line number Diff line number Diff line change
Expand Up @@ -61194,7 +61194,7 @@ class JSRootMenu {
/** @summary Add selection menu entries
* @param {String} name - name of submenu
* @param {Array} values - array of string entries used as list for selection
* @param {String|Number} value - currently elected value, either name or index
* @param {String|Number} value - currently selected value, either name or index
* @param {Function} set_func - function called when item selected, either name or index depending from value parameter
* @param {String} [title] - optional title for menu items
* @protected */
Expand Down Expand Up @@ -65551,6 +65551,8 @@ class TFramePainter extends ObjectPainter {
this.axes_drawn = false;
this.axes2_drawn = false;
this.keys_handler = null;
this._borderMode = 0;
this._borderSize = 0;
this.projection = 0; // different projections
}

Expand Down Expand Up @@ -66243,9 +66245,11 @@ class TFramePainter extends ObjectPainter {
}
}

if (tframe)
if (tframe) {
this.createAttFill({ attr: tframe });
else if (this.fillatt === undefined) {
this._borderMode = tframe.fBorderMode;
this._borderSize = tframe.fBorderSize;
} else if (this.fillatt === undefined) {
if (pad?.fFrameFillColor)
this.createAttFill({ pattern: pad.fFrameFillStyle, color: pad.fFrameFillColor });
else if (pad)
Expand Down Expand Up @@ -66458,9 +66462,8 @@ class TFramePainter extends ObjectPainter {
.attr('viewBox', `0 0 ${this._frame_width} ${this._frame_height}`);

this.draw_g.selectAll('.frame_deco').remove();
const frame = this.getObject();
if (frame?.fBorderMode && this.fillatt.hasColor()) {
const paths = getBoxDecorations(0, 0, this._frame_width, this._frame_height, frame.fBorderMode, frame.fBorderSize || 2, frame.fBorderSize || 2);
if (this._borderMode && this.fillatt.hasColor()) {
const paths = getBoxDecorations(0, 0, this._frame_width, this._frame_height, this._borderMode, this._borderSize || 2, this._borderSize || 2);
this.draw_g.insert('svg:path', '.main_layer')
.attr('class', 'frame_deco')
.attr('d', paths[0])
Expand Down Expand Up @@ -66632,6 +66635,18 @@ class TFramePainter extends ObjectPainter {

menu.addchk(this.isTooltipAllowed(), 'Show tooltips', () => this.setTooltipAllowed('toggle'));
menu.addAttributesMenu(this, alone ? '' : 'Frame ');

menu.sub('Border');
menu.addSelectMenu('Mode', ['Down', 'Off', 'Up'], this._borderMode + 1, v => {
this._borderMode = v - 1;
this.interactiveRedraw(true, `exec:SetBorderMode(${v-1})`);
}, 'Frame border mode');
menu.addSizeMenu('Size', 0, 20, 2, this._borderSize, v => {
this._borderSize = v;
this.interactiveRedraw(true, `exec:SetBorderSize(${v})`);
}, 'Frame border size');
menu.endsub();

menu.add('Save to gStyle', () => {
gStyle.fPadBottomMargin = this.fY1NDC;
gStyle.fPadTopMargin = 1 - this.fY2NDC;
Expand Down Expand Up @@ -73986,7 +74001,7 @@ TPavePainter: TPavePainter
});

const kCARTESIAN = 1, kPOLAR = 2, kCYLINDRICAL = 3, kSPHERICAL = 4, kRAPIDITY = 5,
kNormal$1 = 0, kPoisson = 1, kPoisson2 = 2;
kNormal$1 = 0, kPoisson = 1, kPoisson2 = 2;
/**
* @summary Class to decode histograms draw options
* @desc All options started from capital letter are major drawing options
Expand Down
2 changes: 1 addition & 1 deletion modules/hist2d/THistPainter.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { gamma_quantile, gamma_quantile_c } from '../base/math.mjs';


const kCARTESIAN = 1, kPOLAR = 2, kCYLINDRICAL = 3, kSPHERICAL = 4, kRAPIDITY = 5,
kNormal = 0, kPoisson = 1, kPoisson2 = 2;
kNormal = 0, kPoisson = 1, kPoisson2 = 2;
/**
* @summary Class to decode histograms draw options
* @desc All options started from capital letter are major drawing options
Expand Down

0 comments on commit 3bd4c73

Please sign in to comment.