]> git.sesse.net Git - ccbs/blobdiff - bigscreen/top5chosenscreen.cpp
Center some headings a bit better.
[ccbs] / bigscreen / top5chosenscreen.cpp
index 13cc0b911aeb69029fb816b9642b6fb98ee3ff72..5d2e9dc947bbe421897a65e4f2e5d5fda3f1e660 100644 (file)
@@ -25,6 +25,7 @@ bool Top5ChosenScreen::check_invalidated()
                return true;
        if (!scores_changed.get_flag())
                return false;
+       scores_changed.reset_flag();
 
        // check that there are indeed changes, otherwise don't bother
        std::vector<TopChosen> scores;
@@ -32,6 +33,7 @@ bool Top5ChosenScreen::check_invalidated()
 
        for (std::vector<TopChosen>::const_iterator i = scores.begin(); i != scores.end(); ++i) {
                if (seen_topchosen.count(*i) == 0) {
+                       valid = false;
                        return true;
                }       
        }
@@ -56,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);
-       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) {