Skip to content

Commit

Permalink
[gui] Do not reset FitPanel params when ADD on top of prefit function
Browse files Browse the repository at this point in the history
Fixes #11021
  • Loading branch information
ferdymercury authored Apr 5, 2024
1 parent e32e317 commit 09f9a43
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions gui/fitpanel/src/TFitEditor.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2495,7 +2495,7 @@ void TFitEditor::DoFunction(Int_t selected)
}
else if (fConv->GetState() == kButtonDown)
{
// If the normadd button is down don't replace the fEnteredFunc text
// If the conv button is down don't replace the fEnteredFunc text
Int_t np = 0;
TString s = "";
if (!strcmp(fEnteredFunc->GetText(), ""))
Expand Down Expand Up @@ -2536,8 +2536,12 @@ void TFitEditor::DoFunction(Int_t selected)
TF1* fitFunc = GetFitFunction();
//std::cout << "TFitEditor::DoFunction - using function " << fitFunc->GetName() << " " << fitFunc << std::endl;

if ( fitFunc && (unsigned int) fitFunc->GetNpar() != fFuncPars.size() )
fFuncPars.clear();
if ( fitFunc && (unsigned int) fitFunc->GetNpar() != fFuncPars.size() ) {
if (fAdd->GetState() == kButtonDown || fNormAdd->GetState() == kButtonDown || fConv->GetState() == kButtonDown)
fFuncPars.resize(fitFunc->GetNpar());
else
fFuncPars.clear();
}
if ( fitFunc ) {
//std::cout << "TFitEditor::DoFunction - deleting function " << fitFunc->GetName() << " " << fitFunc << std::endl;
delete fitFunc;
Expand Down

0 comments on commit 09f9a43

Please sign in to comment.