Skip to content

Conversation

@linev
Copy link
Member

@linev linev commented Oct 30, 2025

This method used when graph drawn with "rx" or "ry" draw option.

Example is: https://github.com/root-project/root/blob/master/roottest/graphics/macros/graphs/graphreverse.C

Following problems are resolved:

  1. Zooming of Y axis. While TH1 used for axis painting. Y min/max stored in fMininum/fMaximum members of histogram. So one have to use these values for painting of Y axis.
  2. Unzoom of Y axis - fMinimum/fMaximum of histogram set to 0 and need to be properly configured again.
  3. Memory leak - new TGaxis object and reversed graph was not deleted
  4. Eliminate gPad->Update() inside painter which completely screw-up painting of TCanvas making wired PS/SVG output. Found with new stressGraphics tests in Increase number of tests in stressGraphics #20216

linev added 3 commits October 30, 2025 08:24
If both options are specified, X painting can be corrupted. While gPad->Update called after reverse X axis was painted - removing everything again.

Now call gPad->Update() inside PaintGraphReverse before actual reverse axes are painted.
Delete temporary TGraph and TGaxis objects used only for painting.
These objects do not appears in canvas list of primitives, therfore cannot be cleaned up
Visisble Y range configured in the fMinimum/fMaximum values of histogram and not in the axis properties.
Extra handling unzoom action when fMinimum == fMaximum == 0.

More important - remove unnecessary gPad->Update() to prevent unpredictable results during painting.

Resolves error with new stressGraphics tests
@linev linev requested a review from couet October 30, 2025 07:37
@linev linev self-assigned this Oct 30, 2025
@linev linev requested a review from lmoneta as a code owner October 30, 2025 07:37
@github-actions
Copy link

Test Results

    22 files      22 suites   3d 22h 37m 40s ⏱️
 3 702 tests  3 702 ✅ 0 💤 0 ❌
79 511 runs  79 511 ✅ 0 💤 0 ❌

Results for commit de83449.

@dpiparo
Copy link
Member

dpiparo commented Oct 30, 2025

Thanks!

@dpiparo dpiparo merged commit 58a86f2 into root-project:master Oct 30, 2025
28 of 29 checks passed
@linev linev deleted the fix_grpaint_master branch October 30, 2025 12:29
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.

3 participants