Fix blurriness of svg icons (#1108)

This commit is contained in:
q234rty 2022-06-28 20:14:23 +08:00 committed by GitHub
parent 3256d9bafe
commit 7a29531739
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 1 deletions

View file

@ -5,10 +5,11 @@
#include "ColorImageProvider.h"
#include <QIcon>
#include <QPainter>
QPixmap
ColorImageProvider::requestPixmap(const QString &id, QSize *size, const QSize &)
ColorImageProvider::requestPixmap(const QString &id, QSize *size, const QSize &req)
{
auto args = id.split('?');
@ -17,6 +18,8 @@ ColorImageProvider::requestPixmap(const QString &id, QSize *size, const QSize &)
if (size)
*size = QSize(source.width(), source.height());
if (req.width() > 0 && req.height() > 0)
source = QIcon(args[0]).pixmap(req);
if (args.size() < 2)
return source;