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:
parent
f9eab019a9
commit
32e1a16ead
@ -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 ) );
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user