[graphics] Fix storage of subpad into image file#22022
Merged
linev merged 15 commits intoroot-project:masterfrom Apr 24, 2026
Merged
[graphics] Fix storage of subpad into image file#22022linev merged 15 commits intoroot-project:masterfrom
linev merged 15 commits intoroot-project:masterfrom
Conversation
Subpad has offset in coordinate system which can be calculated when new page is started
Specify exactly pad which will be used for text painting It used to correctly scale text and to check clipping rules. Extra offset x/y needed when sub-pad is stored and graphical coordinates of pad differs from absolute pad coordinates in the canvas
Most crucial change is correct clipping rule check using provided offset.
Important is providing offsets for pad
Index was checked on max value, but not on negative value
It ensure that temporary allocated data removed shortly after string rendering. Otherwise at the end some part can remain. Also use it internally in methods like TTF::GetTextExtent Made TTF::Init() reentrant
Always call TTF::Init() while it is re-entrant now
Always call TTF::Init();
Always call TTF::Init()
Always call TTF::Init() - it is reentrant
Can be easily used in the future from multithreads
couet
approved these changes
Apr 23, 2026
Instead of old style with lot of static variables just use std::vector for points arrays and dash array
Replace static variables by members, use vector.
Base class holds fStream pointer which used for file output in derived classes. Provide methods to open and close this file stream. For special usecase (PDF) binary stream output need to be configured for Windows.
Do not initialize fStream member in constructors - it belongs to base classes. Use everywhere `Error()` method to report errors Small other adjustments
Test Results 22 files 22 suites 3d 8h 26m 13s ⏱️ For more details on these failures, see this check. Results for commit 6589bf3. ♻️ This comment has been updated with latest results. |
Member
Author
|
Failure on alma in fitpanel testing - will be fixed extra |
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.
When
TPad::SaveAs()was called for sub-pad corrupted image was generated or in some case ROOT just crashed.TImageDumpTASImage::DrawTextOnPad()method to correctly mimic fact thatTASImageuses pad coordinates and checks pad boundaries when draw text. Method also include optional offset.TASImage. Affects most of the methods. Backport provided for 6.40 Backport graphics fixes to 6.40 #22021, one also can backport to older branches.TTF::CleanupGlyps()method and use it in all relevant places. Try to avoid memory leak after text rendering.TImageDumpmethods to use less static variables and prefer std::vector usageTVirtualPSprovideOpenStream()andCloseStream()methods to manage file stream centrally