[graphics] modernize BBox handling in several classes#22167
Open
linev wants to merge 7 commits intoroot-project:masterfrom
Open
[graphics] modernize BBox handling in several classes#22167linev wants to merge 7 commits intoroot-project:masterfrom
linev wants to merge 7 commits intoroot-project:masterfrom
Conversation
Test Results 22 files 22 suites 3d 12h 25m 7s ⏱️ For more details on these failures, see this check. Results for commit 7b392e8. ♻️ This comment has been updated with latest results. |
Exclude gVirtualX usage, invoke pad painter methods insted Fully support NDC and normal coordiantes during moving
Like line drawing, one should use absolute coordinates when non-opaque drawing enabled.
For many classes it is good guess that center of bbox is geometrical center. So one not need to reimplement it many times - just reuse values from GetBBox. And when setting bbox center - one can directly call setx and sety methods. Other classes will be updated correspondently Also provide convenience methods to convert pad coordinates into X and Y user coordinates - or NDC. While these methods used very often.
One has to use absolute coordinates
Support NDC coordinates Implement only few methods, other reusing them Simplify code by very large extend
One not need to redefine similar methods - now base class helps us
TLine defines now less virtual methods
couet
approved these changes
May 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There are TAttBBox2D methods which are used in
TPad::ShowGuidelinesduring objects moving.These methods have several issues:
TPad::PixeltoY()method which does not do that it shouldI propose to add several protected methods in base
TAttBBox2Dclass for coordinates transformation.And use these methods in all derived classes to simplify code and resolve mentioned issues.
Also start reduce usage of
TPad::PixeltoY()method.Its main problem - it does not return real user coordinates but with some shift.
To get user Y coordinate one have to call:
It is so since ROOT beginning - but it is wrong.
Reducing its usage in the code let us in the future fix wired behavior.