Skip to content

[pad] Improve TCanvas::FeedbackMode - #23312

Open
linev wants to merge 22 commits into
root-project:masterfrom
linev:pad_feedback
Open

[pad] Improve TCanvas::FeedbackMode#23312
linev wants to merge 22 commits into
root-project:masterfrom
linev:pad_feedback

Conversation

@linev

@linev linev commented Sep 9, 2026

Copy link
Copy Markdown
Member

Method now return boolean, which indicates if such mode supported by canvas.
It requires usage of invert painting and double-buffer support.
For now it works in plain and GL painters
Pad painter has boolean method which indicates if invert painting method is supported.

Fully rewrite THistPainter::ShowProjection3(). It was invented 20 years ago and uses wrong pixel -> lego coordinates conversion. Plus many direct gVirtualX calls. Now histpainter fully free from gVirtualX usage.

Continue removing gVirtualX from canvas and pad.
When closing canvas, one select canvas window right before calling gVirtualX->CloseWindow().

linev added 11 commits September 8, 2026 08:02
Feedback mode used to implement specialized interactive painters
like projections display. On some platforms (like web or GL) such invert
painting not implemented. Therefore one can dismiss such interactive
painting completely.

Method now will return kTRUE when mode was really changed.
Also provide method already in the TVirtualPad and redirect call to the canvas.
Before direct gVirtualX calls were used
Do not perform drawing when functionality not available
Like in other places, use pad painter instead direct gVirtualX calls
Allows to requests doublebuffer flag for the pad instance without accessing canvas
Disable invert painting when double buffer was active. Happens when in-between other interactive actions performed on the pad - like resize of dragging of stats box/title.

Avoids artifacts on the pad because of remaining invert zone
Was used to draw outline when TH1 bincontent was modifying
Reduce number of used static variables
Only bin position defined by px1 is relevant for the handling
Do not use unique_ptr while gPad can remove/delete object.
Instead set kCanDelete bit indicating that object can be deleted any time.
Every time check that gPad contains zooming box

Support non-opaque zooming when box not redrawn with all primitives,
but painted directly in inverse mode
In such mode drawing must be done differently and completely fails when GL painter is activated
Instead use of plain gVirtualX convert 3D coordinates into
fictional X/Y coordinates and use pp->DrawPolyLine method
Use indicies for calculating coordinates which extremely simplifies logic

Fully avoid use of gVirtualX in hist painter
linev added 10 commits September 9, 2026 15:45
Search for the position using view->WCtoNDC conversion instead
of heuristic code. Not most efficient, but reliable way to detect
axes bins for building projection.

Compress code around creating projection
Correctly decode options arguement
Use canv->Add methods
Instead direclty use gPad->FeedbackMode and gPad->PaintLine methods.
Via return value of FeedbackMode method one can detect if inverse drawing
in the canvas is possible
No need to check and access TCanvas pointer
Before it was hapenning in TCanvas::Close() but
we removing gVirtualX from there.
Therefore do it explicitely already in TRootCanvas::Close()
Inform that painting can switch to invert mode which used in different interactive drawings
For both gVirtualX-based painting and GL painting it is supported, all other - not
If invert painting can be performed, one returns false.
Now it happens in the canvas implementation and therefore not necessary.
no need to check web or batch flags
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown

Test Results

    18 files      18 suites   3d 1h 15m 35s ⏱️
 3 880 tests  3 878 ✅ 0 💤 2 ❌
61 161 runs  61 156 ✅ 2 💤 3 ❌

For more details on these failures, see this check.

Results for commit d4cebdb.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant