summaryrefslogtreecommitdiffstats
path: root/stats/statsview.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2021-02-06 12:26:54 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2021-02-06 10:05:41 -0800
commit5b6f4685475be7f7b68375fcab465c1626950296 (patch)
tree5321de5a6baff8d6e41e6919a52bae724c300518 /stats/statsview.cpp
parentf1203d365a4a890410038943cdd4aaaaf6ab558c (diff)
downloadsubsurface-5b6f4685475be7f7b68375fcab465c1626950296.tar.gz
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>
Diffstat (limited to 'stats/statsview.cpp')
-rw-r--r--stats/statsview.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/stats/statsview.cpp b/stats/statsview.cpp
index 5514aa35d..eec7b4ba5 100644
--- a/stats/statsview.cpp
+++ b/stats/statsview.cpp
@@ -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>