From f7565c4a0f30f5d0db6b8bf1d40fcf253b5331f0 Mon Sep 17 00:00:00 2001
From: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Date: Mon, 30 Aug 2021 21:36:21 +0200
Subject: [PATCH] core: clear image before rendering SVGs

In renderSVGIconWidth() the image was not cleared, leading
to garbage backgrounds. This should have affected the video
icons. Apparently, nobody is using them..?

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
---
 core/qthelper.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/core/qthelper.cpp b/core/qthelper.cpp
index a244c1471..a526cf569 100644
--- a/core/qthelper.cpp
+++ b/core/qthelper.cpp
@@ -1739,6 +1739,7 @@ QImage renderSVGIconWidth(const char *id, int size)
 	QSvgRenderer svg{QString(id)};
 	QSize svgSize = svg.defaultSize();
 	QImage res(size, size * svgSize.height() / svgSize.width(), QImage::Format_ARGB32);
+	res.fill(Qt::transparent);
 	QPainter painter(&res);
 	svg.render(&painter);
 	return res;