Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-5241

Hardcoded background fill in THStack::Paint

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: 5.34/00
    • Fix Version/s: None
    • Component/s: Graphics
    • Labels:
      None
    • Environment:

      NA

      Description

      Hello ROOT developers...

      Here is a long-standing problem with how THStacks are painted:

      http://root.cern.ch/phpBB3/viewtopic.php?f=3&t=10533

      In THStack::Paint the bottom histogram is hardcoded to have a filled background so it is impossible to overlay THStacks with all histograms having a hollow (or hatched) fill.

      It amazes me this is still a problem!

      I easily get the correct output when commenting out two lines in THStack.cxx:

      800          if (i>0) {                                                             
      801             // Erase before drawing the histogram                               
      802             h1col  = h1->GetFillColor();                                        
      803             h1fill = h1->GetFillStyle();                                        
      804             //h1->SetFillColor(10);                             <==== this line                
      805             //h1->SetFillStyle(1001);                           <==== and this one...                
      806             h1->Paint(loption);                                                 
      807             static TClassRef clTFrame = TClass::GetClass("TFrame",kFALSE);      
      808             TAttFill *frameFill = (TAttFill*)clTFrame->DynamicCast(TAttFill::Class(),gPad->GetFrame());
      809             if (frameFill) {                                                    
      810                h1->SetFillColor(frameFill->GetFillColor());                     
      811                h1->SetFillStyle(frameFill->GetFillStyle());

        Attachments

          Activity

            People

            • Assignee:
              couet Olivier Couet
              Reporter:
              end Noel Dawe (Inactive)
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Planned Start:
                Planned End: