1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-23 00:09:14 +01:00

Merge pull request #4913 from TheUbuntuGuy/blockanalyzerocd

Bound the Block Analyzer's column count
This commit is contained in:
John Maguire 2015-06-22 10:37:49 -04:00
commit 0e8e40267e

View File

@ -76,7 +76,7 @@ void BlockAnalyzer::resizeEvent(QResizeEvent* e) {
// all is explained in analyze()..
// +1 to counter -1 in maxSizes, trust me we need this!
m_columns = qMax(static_cast<uint>(static_cast<double>(width() + 1) / (WIDTH + 1)), MAX_COLUMNS);
m_columns = qMin(static_cast<uint>(static_cast<double>(width() + 1) / (WIDTH + 1)) + 1, MAX_COLUMNS);
m_rows = static_cast<uint>(static_cast<double>(height() + 1) / (HEIGHT + 1));
// this is the y-offset for drawing from the top of the widget