statistics: properly initialized selected scatter items

Scatter items of selected dives were shown in blue when
changing to scatter mode. They should be yellow from the
start, not only when hovering over them.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2022-10-19 22:35:18 +02:00 committed by Dirk Hohndel
parent 7b5381b6de
commit 7d366b9afe
3 changed files with 5 additions and 4 deletions

View file

@ -111,8 +111,9 @@ QRectF ChartPixmapItem::getRect() const
static const int scatterItemDiameter = 10;
static const int scatterItemBorder = 1;
ChartScatterItem::ChartScatterItem(StatsView &v, ChartZValue z) : HideableChartItem(v, z),
positionDirty(false), textureDirty(false), highlight(Highlight::Unselected)
ChartScatterItem::ChartScatterItem(StatsView &v, ChartZValue z, bool selected) : HideableChartItem(v, z),
positionDirty(false), textureDirty(false),
highlight(selected ? Highlight::Selected : Highlight::Unselected)
{
rect.setSize(QSizeF(static_cast<double>(scatterItemDiameter), static_cast<double>(scatterItemDiameter)));
}