statistics: don't place labels at half-integer values

Placing labels at half-integer values gives horrible
rendering artifacts. Therefore, always round to integer
values. The easiest way to do this is right before setting
the position. Introduce a helper function to round QPointF
in such scenarios.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2021-02-06 12:26:54 +01:00 committed by Dirk Hohndel
parent f1203d365a
commit 5b6f468547
7 changed files with 31 additions and 12 deletions

View file

@ -397,8 +397,8 @@ void StatsView::updateTitlePos()
{
if (!title)
return;
title->setPos(QPointF(round(sceneBorder + (boundingRect().width() - title->getRect().width()) / 2.0),
round(sceneBorder)));
QPointF pos(sceneBorder + (boundingRect().width() - title->getRect().width()) / 2.0, sceneBorder);
title->setPos(roundPos(pos));
}
template <typename T, class... Args>