Skip to content

Commit 6a0124f

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 1e660dc commit 6a0124f

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"
@@ -858,7 +859,14 @@ void TWebCanvas::CreatePadSnapshot(TPadWebSnapshot &paddata, TPad *pad, Long64_t
858859
if ((fTF1UseSave == 1) && f1->HasSave())
859860
return;
860861

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

864872
auto create_stats = [&]() {

0 commit comments

Comments
 (0)