mirror of
https://github.com/miek/inspectrum.git
synced 2026-03-24 17:17:07 +01:00
Better fix for export infinite loop
This commit is contained in:
11
plotview.cpp
11
plotview.cpp
@@ -113,8 +113,9 @@ void PlotView::contextMenuEvent(QContextMenuEvent * event)
|
||||
save->setEnabled(src->sampleType() == typeid(std::complex<float>));
|
||||
menu.addAction(save);
|
||||
|
||||
updateView(false);
|
||||
menu.exec(event->globalPos());
|
||||
updateViewRange(false);
|
||||
if(menu.exec(event->globalPos()))
|
||||
updateView(false);
|
||||
}
|
||||
|
||||
void PlotView::cursorsMoved()
|
||||
@@ -459,7 +460,7 @@ void PlotView::scrollContentsBy(int dx, int dy)
|
||||
updateView();
|
||||
}
|
||||
|
||||
void PlotView::updateView(bool reCenter)
|
||||
void PlotView::updateViewRange(bool reCenter)
|
||||
{
|
||||
// Store old view for recentering
|
||||
auto oldViewRange = viewRange;
|
||||
@@ -476,7 +477,11 @@ void PlotView::updateView(bool reCenter)
|
||||
horizontalScrollBar()->value() + (oldViewRange.length() - viewRange.length()) / 2
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
void PlotView::updateView(bool reCenter)
|
||||
{
|
||||
updateViewRange(reCenter);
|
||||
horizontalScrollBar()->setMaximum(std::max(off_t(0), mainSampleSource->count() - ((width() - 1) * samplesPerLine())));
|
||||
|
||||
verticalScrollBar()->setMaximum(std::max(0, plotsHeight() - viewport()->height()));
|
||||
|
||||
Reference in New Issue
Block a user