diff options
Diffstat (limited to 'stats/pieseries.cpp')
-rw-r--r-- | stats/pieseries.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/stats/pieseries.cpp b/stats/pieseries.cpp index f8c5aa980..ff0690bb8 100644 --- a/stats/pieseries.cpp +++ b/stats/pieseries.cpp @@ -6,6 +6,7 @@ #include "statstranslations.h" #include "statsview.h" #include "zvalues.h" +#include "core/selection.h" #include <numeric> #include <math.h> @@ -263,3 +264,13 @@ void PieSeries::unhighlight() items[highlighted].highlight(*item, highlighted, false, (int)items.size()); highlighted = -1; } + +void PieSeries::selectItemsUnderMouse(const QPointF &pos) +{ + int index = getItemUnderMouse(pos); + if (index < 0) + return setSelection({}, nullptr); + + const std::vector<dive *> &dives = items[index].dives; + setSelection(dives, dives.empty() ? nullptr : dives.front()); +} |