From 07c1b0a88317b59f0deee5ad5d3e4febd423acbc Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sat, 18 Feb 2012 15:05:16 +0100 Subject: [PATCH] Center some headings a bit better. --- bigscreen/top10scorescreen.cpp | 3 ++- bigscreen/top5chosenscreen.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bigscreen/top10scorescreen.cpp b/bigscreen/top10scorescreen.cpp index 672a906..275a4f5 100644 --- a/bigscreen/top10scorescreen.cpp +++ b/bigscreen/top10scorescreen.cpp @@ -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); - 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::const_iterator i = scores.begin(); i != scores.end(); ++i) { diff --git a/bigscreen/top5chosenscreen.cpp b/bigscreen/top5chosenscreen.cpp index 702b24f..5d2e9dc 100644 --- a/bigscreen/top5chosenscreen.cpp +++ b/bigscreen/top5chosenscreen.cpp @@ -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); - 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::const_iterator i = scores.begin(); i != scores.end(); ++i) { -- 2.39.2