Skip to content

Commit

Permalink
Build with title position fix
Browse files Browse the repository at this point in the history
  • Loading branch information
linev committed Nov 15, 2024
1 parent cc93007 commit cc40ba6
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 15 deletions.
26 changes: 14 additions & 12 deletions build/jsroot.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://root.cern/js/ v7.8.0
// https://root.cern/js/ v7.8.1
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
Expand All @@ -8,11 +8,11 @@ typeof define === 'function' && define.amd ? define(['exports'], factory) :
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
/** @summary version id
* @desc For the JSROOT release the string in format 'major.minor.patch' like '7.0.0' */
const version_id = '7.8.0',
const version_id = '7.8.x',

/** @summary version date
* @desc Release date in format day/month/year like '14/04/2022' */
version_date = '11/11/2024',
version_date = '15/11/2024',

/** @summary version id and date
* @desc Produced by concatenation of {@link version_id} and {@link version_date}
Expand Down Expand Up @@ -73666,18 +73666,20 @@ class TPavePainter extends ObjectPainter {
} else if ((opt === 'postitle') || painter.isDummyPos(pave)) {
const st = gStyle, fp = painter.getFramePainter();
if (st && fp) {
const midx = st.fTitleX, y2 = st.fTitleY, fsz = st.fTitleFontSize;
let w = st.fTitleW, h = st.fTitleH;

if (!h) h = Math.max((y2 - fp.fY2NDC) * 0.7, (fsz < 1) ? 1.1 * fsz : 1.1 * fsz / fp.getFrameWidth());
if (!w) w = fp.fX2NDC - fp.fX1NDC;
const midx = st.fTitleX, y2 = st.fTitleY,
valign = st.fTitleAlign % 10, halign = (st.fTitleAlign - valign) / 10,
title = pave.fLines?.arr[0]?.fTitle;
let w = st.fTitleW, h = st.fTitleH, fsz = st.fTitleFontSize;
if (fsz > 1) fsz = fsz / fp.getFrameWidth();
if (!h) h = Math.max((y2 - fp.fY2NDC) * 0.7, 1.1 * fsz);
if (!w) w = (halign !== 2 && title) ? title.length * fsz * 0.2 : fp.fX2NDC - fp.fX1NDC;
if (!Number.isFinite(h) || (h <= 0)) h = 0.06;
if (!Number.isFinite(w) || (w <= 0)) w = 0.44;

pave.fX1NDC = midx - w/2;
pave.fY1NDC = y2 - h;
pave.fX2NDC = midx + w/2;
pave.fY2NDC = y2;
pave.fX1NDC = halign < 2 ? midx : (halign > 2 ? midx - w : midx - w/2);
pave.fY1NDC = valign === 3 ? y2 - h : (valign === 2 ? y2 - h / 2 : y2);
pave.fX2NDC = pave.fX1NDC + w;
pave.fY2NDC = pave.fY1NDC + h;
pave.fInit = 1;
}
}
Expand Down
4 changes: 4 additions & 0 deletions changes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# JSROOT changelog

## Changes in 7.8.x
1. Fix - correctly position title according to gStyle->GetTitleAlign()


## Changes in 7.8.0
1. Let use custom time zone for time display, support '&utc' and '&cet' in URL parameters
2. Support gStyle.fLegendFillStyle
Expand Down
4 changes: 2 additions & 2 deletions modules/core.mjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/** @summary version id
* @desc For the JSROOT release the string in format 'major.minor.patch' like '7.0.0' */
const version_id = '7.8.0',
const version_id = '7.8.x',

/** @summary version date
* @desc Release date in format day/month/year like '14/04/2022' */
version_date = '11/11/2024',
version_date = '15/11/2024',

/** @summary version id and date
* @desc Produced by concatenation of {@link version_id} and {@link version_date}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jsroot",
"version": "7.8.0",
"version": "7.8.1",
"engines": {
"node": ">= 0.18.0"
},
Expand Down

0 comments on commit cc40ba6

Please sign in to comment.