TBox behavior change...work around?

I recently switched from root 5.34.01 to 5.34.36. The problem is with TBox: On 5.34.01 I used SetFillStyle(3003) and draw it on top of a scatter plot - the points under the box were still visible - the box was to highlight a region. Now the box is completely opaque. I tried using OpenGL.CanvasePreferGL: 1 in system.rootrc and SetFillColorAlpha() - that worked, but it messed up the zoom behavior on canvases - so I would rather not use that option. Is there another way to achieve a transparent fill w/ 5.34.36

Thank you.
Ed

PS I am a windows user dying to use root 6!!

$ root
  *******************************************
  *                                         *
  *        W E L C O M E  to  R O O T       *
  *                                         *
  *   Version   5.34/37      6 April 2016   *
  *                                         *
  *  You are welcome to visit our Web site  *
  *          http://root.cern.ch            *
  *                                         *
  *******************************************
root [0] .x tbox.C

tbox.C is:

{
   TCanvas *c1 = new TCanvas("c1", "c1",577,175,700,527);
   TLatex *   tex = new TLatex(0.3510029,0.6610526,"Text");
   tex->SetTextSize(0.1978947);
   tex->Draw();
   TBox *box = new TBox(0.5071633,0.6147368,0.7063037,0.84);
   box->SetFillColor(2);
   box->SetFillStyle(3003);
   box->SetLineColor(2);
   box->Draw();
}

It gives me the attached plot

Hi Ed,

I see the problem on Windows (with the macro Olivier just posted). But this seems to only affect the black color… For example try with this one (I just added tex->SetTextColor(kGray+3);):

{ TCanvas *c1 = new TCanvas("c1", "c1",577,175,700,527); TLatex *tex = new TLatex(0.3510029,0.6610526,"Text"); tex->SetTextSize(0.1978947); tex->SetTextColor(kGray+3); tex->Draw(); TBox *box = new TBox(0.5071633,0.6147368,0.7063037,0.84); box->SetFillColor(2); box->SetFillStyle(3003); box->SetLineColor(2); box->Draw(); }
Cheers, Bertrand.

Thanks for the quick reply… This is closer to what I do (I already have a canvas)

{ TNtuple *pt = new TNtuple("pt","demo","x:y"); TRandom3 r; float x,y; for(int i=0;i<10000;i++) { x = i; y = r.Gaus(0,1.); pt->Fill(x,y); } pt->Draw("y:x>>h(10,0,10000,10,-10,10)"); TBox *box = new TBox(0.,-1.,10000.,1.); box->SetFillColor(2); box->SetFillStyle(3003); box->SetLineColor(2); box->Draw(); }

1.gif is with 5.34/1 36.gif is with 5.34/36…


I’ve got to say it looks different after exporting as a gif, but the opaque issue is still evident




Try to add pt->SetMarkerColor(kGray+3); before pt->Draw("y:x>>h(10,0,10000,10,-10,10)");
Cheers, Bertrand.

Thank you both!