From 612d53bfe742e83a641eeb31687f72a8660d885e Mon Sep 17 00:00:00 2001 From: deveee Date: Fri, 18 Oct 2013 07:33:18 +0000 Subject: [PATCH] Use smaller distance between rows if there is no place for all entries. git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@14278 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/states_screens/race_result_gui.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/states_screens/race_result_gui.cpp b/src/states_screens/race_result_gui.cpp index bdf29ec0d..f11b9e271 100644 --- a/src/states_screens/race_result_gui.cpp +++ b/src/states_screens/race_result_gui.cpp @@ -920,7 +920,11 @@ void RaceResultGUI::displaySoccerResults() resultText.append(StringUtils::timeToString(scoreTimes.at(i)).c_str()); rect = m_font->getDimension(resultText.c_str()); - currY += rect.Height; + if(height-prevY < ((short)scorers.size()+1)*(short)rect.Height) + currY += (height-prevY)/((short)scorers.size()+1); + else + currY += rect.Height; + if(currY > height) break; pos = core::rect(currX,currY,currX,currY); @@ -947,7 +951,11 @@ void RaceResultGUI::displaySoccerResults() resultText.append(StringUtils::timeToString(scoreTimes.at(i)).c_str()); rect = m_font->getDimension(resultText.c_str()); - currY += rect.Height; + if(height-prevY < ((short)scorers.size()+1)*(short)rect.Height) + currY += (height-prevY)/((short)scorers.size()+1); + else + currY += rect.Height; + if(currY > height) break; pos = core::rect(currX,currY,currX,currY);