1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-20 07:49:42 +01:00

Keep aspect ratio for image requests with width or height being 0.

This commit is contained in:
Christian Muehlhaeuser 2014-11-20 16:15:59 +01:00
parent fcc772ecc5
commit 5052e39cbc

@ -116,7 +116,12 @@ ImageRegistry::pixmap( const QString& image, const QSize& size, TomahawkUtils::I
}
if ( !size.isNull() && pixmap.size() != size )
pixmap = pixmap.scaled( size, Qt::IgnoreAspectRatio, Qt::SmoothTransformation );
{
Qt::AspectRatioMode aspect = Qt::IgnoreAspectRatio;
if ( size.height() == 0 || size.width() == 0 )
aspect = Qt::KeepAspectRatio;
pixmap = pixmap.scaled( size, aspect, Qt::SmoothTransformation );
}
putInCache( image, size, mode, opacity, pixmap, tint );
}