]> git.sesse.net Git - ccbs/commitdiff
Center some headings a bit better.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 18 Feb 2012 14:05:16 +0000 (15:05 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 18 Feb 2012 14:05:16 +0000 (15:05 +0100)
bigscreen/top10scorescreen.cpp
bigscreen/top5chosenscreen.cpp

index 672a906d9fd5261e011f58ec60beb8384c208304..275a4f5dc998531f1d97dcb8186264cf0b3f841f 100644 (file)
@@ -60,7 +60,8 @@ void Top10ScoreScreen::draw(unsigned char *buf, unsigned width, unsigned height)
        // simple headings
        my_draw_text("Player", buf, 12.0, PLAYER_X, 100);
        my_draw_text("Song", buf, 12.0, SONG_X, 100);
        // simple headings
        my_draw_text("Player", buf, 12.0, PLAYER_X, 100);
        my_draw_text("Song", buf, 12.0, SONG_X, 100);
-       my_draw_text("Score", buf, 12.0, SCORE_X - 18, 100);
+       width = my_draw_text("Score", NULL, 12.0);
+       my_draw_text("Score", buf, 12.0, SCORE_X - width/2, 100);
        
        unsigned row = 1, y = 140;
        for (std::vector<TopScore>::const_iterator i = scores.begin(); i != scores.end(); ++i) {
        
        unsigned row = 1, y = 140;
        for (std::vector<TopScore>::const_iterator i = scores.begin(); i != scores.end(); ++i) {
index 702b24fdab551d5e2e8665abfde40c65b8b1f0d4..5d2e9dc947bbe421897a65e4f2e5d5fda3f1e660 100644 (file)
@@ -58,7 +58,8 @@ void Top5ChosenScreen::draw(unsigned char *buf, unsigned width, unsigned height)
 
        // simple headings
        my_draw_text("Song", buf, 12.0, SONG_X, 100);
 
        // simple headings
        my_draw_text("Song", buf, 12.0, SONG_X, 100);
-       my_draw_text("Frequency", buf, 12.0, FREQUENCY_X - 35, 100);
+       width = my_draw_text("Frequency", NULL, 12.0);
+       my_draw_text("Frequency", buf, 12.0, FREQUENCY_X - width/2, 100);
        
        unsigned row = 1, y = 140;
        for (std::vector<TopChosen>::const_iterator i = scores.begin(); i != scores.end(); ++i) {
        
        unsigned row = 1, y = 140;
        for (std::vector<TopChosen>::const_iterator i = scores.begin(); i != scores.end(); ++i) {