Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use legend entry's option instead of object's DrawOption when deciding endcaps #17332

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
10 changes: 4 additions & 6 deletions graf2d/graf/src/TLegend.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -809,14 +809,12 @@ void TLegend::PaintPrimitives()
// bar are drawn differently.
Int_t endcaps = 0; // no endcaps.
if (eobj) { // eobj == nullptr for the legend header
TString eobjopt = eobj->GetDrawOption();
eobjopt.ToLower();
if (eobjopt.Contains("e1") && eobj->InheritsFrom(TH1::Class())) endcaps = 1; // a bar
if (opt.Contains("e1") && eobj->InheritsFrom(TH1::Class())) endcaps = 1; // a bar
if (eobj->InheritsFrom(TGraph::Class())) {
endcaps = 1; // a bar, default for TGraph
if (eobjopt.Contains("z")) endcaps = 0; // no endcaps.
if (eobjopt.Contains(">")) endcaps = 2; // empty arrow.
if (eobjopt.Contains("|>")) endcaps = 3; // filled arrow.
if (opt.Contains("z")) endcaps = 0; // no endcaps.
if (opt.Contains(">")) endcaps = 2; // empty arrow.
if (opt.Contains("|>")) endcaps = 3; // filled arrow.
}
}
float arrow_shift = 0.3;
Expand Down