From 6d17d1d761b278e44869426135f24899ea029e5a Mon Sep 17 00:00:00 2001 From: will-cern Date: Sat, 21 Dec 2024 12:33:07 +0000 Subject: [PATCH] Use legend entry's option instead of objects option, to support case where legend is drawn to a different pad than the object --- graf2d/graf/src/TLegend.cxx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/graf2d/graf/src/TLegend.cxx b/graf2d/graf/src/TLegend.cxx index 848908537d524..adacc15c8edc0 100644 --- a/graf2d/graf/src/TLegend.cxx +++ b/graf2d/graf/src/TLegend.cxx @@ -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;