mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
f1203d365a
commit
5b6f468547
7 changed files with 31 additions and 12 deletions
10
stats/statshelper.cpp
Normal file
10
stats/statshelper.cpp
Normal file
|
@ -0,0 +1,10 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
#include "statshelper.h"
|
||||
|
||||
#include <cmath>
|
||||
|
||||
QPointF roundPos(const QPointF &p)
|
||||
{
|
||||
return QPointF(round(p.x()), round(p.y()));
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue