From 4f58e9aa62d29a31ff8df74bea75cb770a0d50ff Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Tue, 19 Jan 2021 16:09:56 +0100 Subject: statistics: render bar and pie labels onto fill color The labels in bar an pie charts are realized as individual QSG pixmap nodes with an alpha channel. Sadly, rendering bright labels onto a transparent background gives very ugly artifacts. As a stop gap measure, until the problem is understood, render on a background with the color of the pie slice or bar. Signed-off-by: Berthold Stoeger --- stats/chartitem.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'stats/chartitem.cpp') diff --git a/stats/chartitem.cpp b/stats/chartitem.cpp index 7c5339596..c8bdd130e 100644 --- a/stats/chartitem.cpp +++ b/stats/chartitem.cpp @@ -242,7 +242,12 @@ ChartTextItem::ChartTextItem(StatsView &v, ChartZValue z, const QFont &f, const void ChartTextItem::setColor(const QColor &c) { - img->fill(Qt::transparent); + setColor(c, Qt::transparent); +} + +void ChartTextItem::setColor(const QColor &c, const QColor &background) +{ + img->fill(background); double y = 0.0; painter->setPen(QPen(c)); painter->setFont(f); -- cgit v1.2.3-70-g09d2