From 1043554591d8208fc1b1cb504086216ae2aa3799 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sun, 15 May 2005 16:19:43 +0000 Subject: Word wrap the 'features' string svn-id: r18110 --- gui/about.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'gui') diff --git a/gui/about.cpp b/gui/about.cpp index 7e1b267654..c44c444b92 100644 --- a/gui/about.cpp +++ b/gui/about.cpp @@ -110,9 +110,19 @@ AboutDialog::AboutDialog() date += ')'; _lines.push_back(date); - Common::String features("\\C\\c2""Supports: "); + Common::String features("Supports: "); features += gScummVMFeatures; - _lines.push_back(features); + + // If the features string is too wide, split it up + const int maxWidth = _w - 2*kXOff; + if (_font->getStringWidth(features) > maxWidth) { + Common::StringList wrappedLines; + _font->wordWrapText(features, maxWidth, wrappedLines); + + for (i = 0; i < (int)wrappedLines.size(); ++i) + _lines.push_back("\\C\\c2" + wrappedLines[i]); + } else + _lines.push_back("\\C\\c2" + features); _lines.push_back(""); @@ -207,7 +217,7 @@ void AboutDialog::drawDialog() { while (*str && *str == ' ') str++; - _font->drawString(&g_gui.getScreen(), str, _x + kXOff, y, _w - 2 * kXOff, color, align); + _font->drawString(&g_gui.getScreen(), str, _x + kXOff, y, _w - 2 * kXOff, color, align, 0, false); y += _lineHeight; } -- cgit v1.2.3