Skip to content

Commit

Permalink
Fix right-click context menu failure for data-defined peaks.
Browse files Browse the repository at this point in the history
  • Loading branch information
wcjohns committed Jan 14, 2025
1 parent 9af6612 commit 9e2d706
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/PeakSearchGuiUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3132,7 +3132,11 @@ std::pair<std::unique_ptr<ReferenceLineInfo>,int> reference_line_near_peak( Inte
if( !refLineTool )
return pair<unique_ptr<ReferenceLineInfo>,int>( nullptr, -1 );

const double mean = peak.mean(), sigma = peak.sigma();
const double mean = peak.gausPeak() ? peak.mean()
: (((peak.mean() > peak.lowerX()) && (peak.mean() < peak.upperX()))
? peak.mean()
: 0.5*(peak.lowerX() + peak.upperX()));
const double sigma = peak.gausPeak() ? peak.sigma() : 0.25f*peak.roiWidth();
const double lx = peak.lowerX(), ux = peak.upperX();

double largest_w = -9999, best_energy = -1.0f;
Expand Down

0 comments on commit 9e2d706

Please sign in to comment.