From 43b0ccca3e8db081378d0924de257b4185b90464 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Wed, 10 Feb 2021 12:15:14 +0100 Subject: statistics: support ctrl-selection for all series Multiple selection using ctrl was only supported for scatter series. Factor out the corresponding code and use it in all series. Signed-off-by: Berthold Stoeger --- stats/barseries.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'stats/barseries.cpp') 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 &dives = items[index.bar].subitems[index.subitem].dives; - setSelection(dives, dives.empty() ? nullptr : dives.front()); - return true; + std::vector 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 &) -- cgit v1.2.3-70-g09d2