Skip to content

Commit c033379

Browse files
committed
Prevent browser navigation from touch events on time chart.
Also fixed some minor warnings/compile issues on Windows.
1 parent 1a62e29 commit c033379

File tree

4 files changed

+25
-3
lines changed

4 files changed

+25
-3
lines changed

InterSpec_resources/D3TimeChart.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
flex-grow: 4;
88
height: 100%;
99
overflow: hidden;
10+
11+
/* Prevent a finger swipe on the chart making the browser go back in browsing history. */
12+
touch-action: none;
13+
overscroll-behavior-x: none;
1014
}
1115

1216

src/PeakDef.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2439,8 +2439,9 @@ std::string PeakDef::gaus_peaks_to_json(const std::vector<std::shared_ptr<const
24392439
answer << "]," << q << "continuumCounts" << q << ":[";
24402440
}
24412441
*/
2442-
2442+
#ifndef _WIN32
24432443
#warning "Can make computing continuumCounts for FlatStep/LinearStep/BiLinearStep so much more efficient"
2444+
#endif
24442445
for (size_t i = firstbin; i <= lastbin; ++i)
24452446
{
24462447
const float lower_x = foreground->gamma_channel_lower( i );
@@ -4167,8 +4168,9 @@ double PeakContinuum::offset_integral( const double x0, const double x1,
41674168
// If you change any of this, make sure you update fit_amp_and_offset(...) as well
41684169

41694170
// TODO: this is not efficient, tested, or correct if integration limits do not correspond to channel limits
4170-
#warning "TODO: Flat/Linear/BiLinear-Step offset_integral is not efficient, tested, or correct"
4171-
4171+
#ifndef _WIN32
4172+
#warning "TODO: Flat/Linear/BiLinear-Step offset_integral is not efficient, tested, or correct"
4173+
#endif
41724174
double roi_lower, roi_upper, cumulative_data, roi_data_sum;
41734175
integrate_for_step( roi_lower, roi_upper, cumulative_data, roi_data_sum );
41744176

src/PeakFit.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7097,6 +7097,10 @@ void AutoPeakSearchChi2Fcn::fit_peak_group( const vector<PeakDef> &peaks,
70977097
case PeakContinuum::BiLinearStep:
70987098
return 2 + (cont->type() - PeakContinuum::FlatStep);
70997099
}//switch( cont->type() )
7100+
7101+
assert(0);
7102+
throw std::runtime_error( "Somehow invalid continuum polynomial type." );
7103+
return 0;
71007104
})();
71017105

71027106
const bool isStepContinuum = ([&cont]() -> bool {
@@ -7112,6 +7116,10 @@ void AutoPeakSearchChi2Fcn::fit_peak_group( const vector<PeakDef> &peaks,
71127116
case PeakContinuum::BiLinearStep:
71137117
return true;
71147118
}//switch( cont->type() )
7119+
7120+
assert( 0 );
7121+
throw std::runtime_error( "Somehow invalid continuum polynomial type." );
7122+
return 0;
71157123
})();
71167124

71177125

src/PeakFitChi2Fcn.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1589,6 +1589,10 @@ double LinearProblemSubSolveChi2Fcn::parametersToPeaks( vector<PeakDef> &peaks,
15891589
case PeakContinuum::BiLinearStep:
15901590
return 2 + (m_offsetType - PeakContinuum::FlatStep);
15911591
}//switch( cont->type() )
1592+
1593+
assert( 0 );
1594+
throw std::runtime_error( "Somehow invalid continuum polynomial type." );
1595+
return 0;
15921596
})();
15931597

15941598
const bool step_continuum = ([this]() -> int {
@@ -1604,6 +1608,10 @@ double LinearProblemSubSolveChi2Fcn::parametersToPeaks( vector<PeakDef> &peaks,
16041608
case PeakContinuum::BiLinearStep:
16051609
return true;
16061610
}//switch( cont->type() )
1611+
1612+
assert( 0 );
1613+
throw std::runtime_error( "Somehow invalid continuum polynomial type." );
1614+
return false;
16071615
})();
16081616

16091617
vector<double> amps, offsets, amps_uncerts, offsets_uncerts;

0 commit comments

Comments
 (0)