mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-09 07:36:48 +02:00
Keep aspect ratio for image requests with width or height being 0.
This commit is contained in:
@@ -116,7 +116,12 @@ ImageRegistry::pixmap( const QString& image, const QSize& size, TomahawkUtils::I
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( !size.isNull() && pixmap.size() != size )
|
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 );
|
putInCache( image, size, mode, opacity, pixmap, tint );
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user