subsurface/stats/statshelper.cpp
Berthold Stoeger 5b6f468547 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>
2021-02-06 10:05:41 -08:00

10 lines
165 B
C++

// SPDX-License-Identifier: GPL-2.0
#include "statshelper.h"
#include <cmath>
QPointF roundPos(const QPointF &p)
{
return QPointF(round(p.x()), round(p.y()));
}