summaryrefslogtreecommitdiffstats
path: root/stats/barseries.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'stats/barseries.cpp')
-rw-r--r--stats/barseries.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/stats/barseries.cpp b/stats/barseries.cpp
index 0f931e367..95b02111e 100644
--- a/stats/barseries.cpp
+++ b/stats/barseries.cpp
@@ -411,17 +411,16 @@ void BarSeries::unhighlight()
highlighted = Index();
}
-bool BarSeries::selectItemsUnderMouse(const QPointF &pos, SelectionModifier)
+bool BarSeries::selectItemsUnderMouse(const QPointF &pos, SelectionModifier modifier)
{
Index index = getItemUnderMouse(pos);
- if (index.bar < 0) {
- setSelection({}, nullptr);
- return false;
- }
- const std::vector<dive *> &dives = items[index.bar].subitems[index.subitem].dives;
- setSelection(dives, dives.empty() ? nullptr : dives.front());
- return true;
+ std::vector<dive *> divesUnderMouse;
+ if (index.bar >= 0)
+ divesUnderMouse = items[index.bar].subitems[index.subitem].dives;
+ processSelection(std::move(divesUnderMouse), modifier);
+
+ return index.bar >= 0;
}
void BarSeries::divesSelected(const QVector<dive *> &)