Dive pictures: render icons with white instead of transparent background

The SVG icons for failed / still-loading pictures were rendered with an
alpha channel. This lead to strange behavior when hovering over the
icon in the profile plot: When hitting a "hole" the icon would be
minimized again.

Therefore, render the SVGs onto a white background.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2018-05-20 22:35:29 +02:00 committed by Dirk Hohndel
parent e79d177c71
commit 1a5e54e5eb

View file

@ -121,7 +121,8 @@ static std::pair<QImage, bool> getHashedImage(const QString &filename, bool tryD
static QImage renderIcon(const char *id, int size)
{
QImage res(size, size, QImage::Format_ARGB32);
QImage res(size, size, QImage::Format_RGB32);
res.fill(Qt::white);
QSvgRenderer svg{QString(id)};
QPainter painter(&res);
svg.render(&painter);