Skip to content

Commit a2a70bb

Browse files
committed
Build with TCanvas support in build3d
1 parent 01ba8fb commit a2a70bb

File tree

3 files changed

+29
-4
lines changed

3 files changed

+29
-4
lines changed

build/jsroot.js

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const version_id = 'dev',
1414

1515
/** @summary version date
1616
* @desc Release date in format day/month/year like '14/04/2022' */
17-
version_date = '24/11/2025',
17+
version_date = '25/11/2025',
1818

1919
/** @summary version id and date
2020
* @desc Produced by concatenation of {@link version_id} and {@link version_date}
@@ -91042,6 +91042,20 @@ class TCanvasPainter extends TPadPainter {
9104291042
this.getWebsocket()?.resizeWindow(fullW, fullH);
9104391043
}
9104491044

91045+
/** @summary create three.js object for TCanvas */
91046+
static async build3d(can, opt, get_painter) {
91047+
const painter = new TCanvasPainter(null, can, opt, true);
91048+
painter.checkSpecialsInPrimitives(can, true);
91049+
91050+
const fp = new TFramePainter(null, null);
91051+
// return dummy frame painter as result
91052+
painter.getFramePainter = () => fp;
91053+
91054+
return painter.drawPrimitives().then(() => {
91055+
return get_painter ? painter : fp.create3DScene(-1, true);
91056+
});
91057+
}
91058+
9104591059
/** @summary draw TCanvas */
9104691060
static async draw(dom, can, opt) {
9104791061
const nocanvas = !can;
@@ -91313,6 +91327,11 @@ class TPavePainter extends ObjectPainter {
9131391327
opt = this.getPaveDrawOption().toUpperCase(),
9131491328
fp = this.getFramePainter(), pp = this.getPadPainter(),
9131591329
pad = pp.getRootPad(true);
91330+
91331+
// special handling of dummy frame painter
91332+
if (fp?.getDrawDom() === null)
91333+
return this;
91334+
9131691335
let interactive_element, width, height;
9131791336

9131891337
if (pt.fInit === 0) {
@@ -169359,6 +169378,11 @@ class TTextPainter extends ObjectPainter {
169359169378
pp = this.getPadPainter(),
169360169379
fp = this.getFramePainter(),
169361169380
is_url = text.fName.startsWith('http://') || text.fName.startsWith('https://');
169381+
169382+
// special handling of dummy frame painter
169383+
if (fp?.getDrawDom() === null)
169384+
return this;
169385+
169362169386
let fact = 1, use_frame = false;
169363169387

169364169388
this.createAttText({ attr: text });

changes.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33

44
## Changes in dev
5-
1. Resort order of ranges in http request, fixing several problems #374
5+
1. Resort order of ranges in http request, fixing several long-standing problems #374
66
1. Implement for `TPie` 3d, text, title drawing including interactivity
7-
1. Remove support for deprectaed TH1K class
7+
1. Implement `TCanvas` support in `build3d` function #373
8+
1. Remove support for deprectaed `TH1K` class
89
1. Fix - proper paint axis labels on both sides when pad.fTickx/y = 2
910
1. Fix - paint frame border mode/size from TCanvas
1011

modules/core.mjs

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

77
/** @summary version date
88
* @desc Release date in format day/month/year like '14/04/2022' */
9-
version_date = '24/11/2025',
9+
version_date = '25/11/2025',
1010

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

0 commit comments

Comments
 (0)