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

Guard against divide-by-0

This commit is contained in:
Leo Franchi 2012-05-17 12:56:48 -04:00
parent f9eab019a9
commit 32e1a16ead

View File

@ -190,7 +190,7 @@ AlbumView::resizeEvent( QResizeEvent* event )
int itemWidth = 160;
QSize itemSize = m_proxyModel->data( QModelIndex(), Qt::SizeHintRole ).toSize();
int itemsPerRow = qFloor( rectWidth / itemWidth );
int itemsPerRow = qMax( 1, qFloor( rectWidth / itemWidth ) );
// int rightSpacing = rectWidth - ( itemsPerRow * ( itemSize.width() + 16 ) );
// int newSpacing = 16 + floor( rightSpacing / ( itemsPerRow + 1 ) );