Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions graf2d/gpad/src/TCanvas.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,7 @@ void TCanvas::Build()
} else {
//normal mode with a screen window
// Set default physical canvas attributes
if (!fPainter) return;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this early return dangerous? It will leave a bunch of stuff uninitialized that may be assumed to exist later (such as fContextMenu, fPrimitives, ...)

It will also not add this canvas to the global list, which leaves it in a weird half-constructed state..

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is better solution #22911

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My fix was mainly a temporary one to show where the problem was. It helped the user who reported the problem.

fPainter->SelectDrawable(fCanvasID);
fPainter->SetAttFill({1, 1001}); //Set color index for fill area
fPainter->SetAttLine({1, 1, 1}); //Set color index for lines
Expand Down
Loading