Skip to content

Commit e8a21cb

Browse files
committed
[webcanv] fix storage of TF1 values
One cannot use default 0,0 values while than smaller buffer is allocated and it not recognized by painters later
1 parent e7fcd38 commit e8a21cb

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

gui/webgui6/src/TWebCanvas.cxx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include "TList.h"
3535
#include "TF1.h"
3636
#include "TF2.h"
37+
#include "TF3.h"
3738
#include "TH1.h"
3839
#include "TH2.h"
3940
#include "THStack.h"
@@ -857,7 +858,14 @@ void TWebCanvas::CreatePadSnapshot(TPadWebSnapshot &paddata, TPad *pad, Long64_t
857858
if ((fTF1UseSave == 1) && f1->HasSave())
858859
return;
859860

860-
f1->Save(0, 0, 0, 0, 0, 0);
861+
auto f3 = dynamic_cast<TF3 *>(f1);
862+
auto f2 = dynamic_cast<TF2 *>(f1);
863+
if (f3)
864+
f3->Save(f3->GetXmin(), f3->GetXmax(), f3->GetYmin(), f3->GetYmax(), f3->GetZmin(), f3->GetZmax());
865+
else if (f2)
866+
f2->Save(f2->GetXmin(), f2->GetXmax(), f2->GetYmin(), f2->GetYmax(), 0, 0);
867+
else
868+
f1->Save(f1->GetXmin(), f1->GetXmax(), 0, 0, 0, 0);
861869
};
862870

863871
auto create_stats = [&]() {

0 commit comments

Comments
 (0)