From: Steinar H. Gunderson Date: Sat, 19 Feb 2005 19:19:34 +0000 (+0000) Subject: Center song headings as well. X-Git-Url: https://git.sesse.net/?p=ccbs;a=commitdiff_plain;h=9b9c0a0492feb4f6ba5567c98dd778ac1410a98f Center song headings as well. --- diff --git a/bigscreen/groupscreen.cpp b/bigscreen/groupscreen.cpp index 5e448ac..09c4389 100644 --- a/bigscreen/groupscreen.cpp +++ b/bigscreen/groupscreen.cpp @@ -53,8 +53,10 @@ void GroupScreen::draw(unsigned char *buf) // make column headings from the first player's songs unsigned col = 1, x = 40 + width[0]; for (std::vector::const_iterator i = group.players[0].scores.begin(); i != group.players[0].scores.end(); ++i, ++col) { - if (!i->chosen) - my_draw_text(i->song.title, buf, 12.0, x, 30); + if (!i->chosen) { + unsigned this_width = my_draw_text(i->song.title, NULL, 12.0); + my_draw_text(i->song.title, buf, 12.0, x + width[col] / 2 - this_width / 2, 30); + } x += width[col] + 20; }