diff options
Diffstat (limited to 'stats/barseries.cpp')
-rw-r--r-- | stats/barseries.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/stats/barseries.cpp b/stats/barseries.cpp index 8767a04db..a501ddea9 100644 --- a/stats/barseries.cpp +++ b/stats/barseries.cpp @@ -6,6 +6,7 @@ #include "statstranslations.h" #include "statsview.h" #include "zvalues.h" +#include "core/selection.h" #include <math.h> // for lrint() #include <QLocale> @@ -404,3 +405,13 @@ void BarSeries::unhighlight() items[highlighted.bar].highlight(highlighted.subitem, false, binCount()); highlighted = Index(); } + +void BarSeries::selectItemsUnderMouse(const QPointF &pos) +{ + Index index = getItemUnderMouse(pos); + if (index.bar < 0) + return setSelection({}, nullptr); + + const std::vector<dive *> &dives = items[index.bar].subitems[index.subitem].dives; + setSelection(dives, dives.empty() ? nullptr : dives.front()); +} |