Skip to content

Commit

Permalink
Fix: Check for empty EIC when zooming out #553
Browse files Browse the repository at this point in the history
Corner case: Calling ResetZoom for MS2 data gave a blank widget for empty EIC with no expected Rt.

The function now checks if the EIC in the widget is empty and sets the axis bounds equal to sample bounds.

Issue: #553
  • Loading branch information
shubhra-agrawal authored and sahil21 committed Feb 7, 2018
1 parent ebb5c85 commit a9d0b01
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/gui/mzroll/eicwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1322,7 +1322,11 @@ void EicWidget::resetZoom() {
//qDebug <<"EicWidget::resetZoom() ";
mzSlice bounds(0, 0, 0, 0);

if (eicParameters->eics.size() > 0) {
bool hasData = false;
for (int i = 0; i < eicParameters->eics.size(); i++)
if (eicParameters->eics[i]->size() > 0) hasData = true;

if (hasData) {
bounds = eicParameters->visibleEICBounds();
} else if (getMainWindow()->sampleCount() > 0) {
vector<mzSample*> samples = getMainWindow()->getVisibleSamples();
Expand Down

0 comments on commit a9d0b01

Please sign in to comment.