From 36d885b73daf9af0a5b8a95e55b6abf051fa8048 Mon Sep 17 00:00:00 2001 From: Mark Furneaux Date: Sat, 20 Jun 2015 00:09:38 -0400 Subject: [PATCH] Bound the Block Analyzer's column count As it stands, the block analyzer just chops off columns to the right if the window is too small and always internally runs off 256 columns. Since the analyzer is bounded to 256 colums, this qMax bound is totally pointless. It also makes the demo asymmetrical which trips up my OCD whenever Clementine is idling... --- src/analyzers/blockanalyzer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/analyzers/blockanalyzer.cpp b/src/analyzers/blockanalyzer.cpp index 7ff0830c0..bb6807a63 100644 --- a/src/analyzers/blockanalyzer.cpp +++ b/src/analyzers/blockanalyzer.cpp @@ -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(static_cast(width() + 1) / (WIDTH + 1)), MAX_COLUMNS); + m_columns = qMin(static_cast(static_cast(width() + 1) / (WIDTH + 1)) + 1, MAX_COLUMNS); m_rows = static_cast(static_cast(height() + 1) / (HEIGHT + 1)); // this is the y-offset for drawing from the top of the widget