diff options
author | Max Horn | 2005-05-15 16:19:43 +0000 |
---|---|---|
committer | Max Horn | 2005-05-15 16:19:43 +0000 |
commit | 1043554591d8208fc1b1cb504086216ae2aa3799 (patch) | |
tree | d281747234e5dcf3b5e3c8b8d406b3933eb50b5c | |
parent | 4d5073b15432d30f9bd9434984ee84ae08976efb (diff) | |
download | scummvm-rg350-1043554591d8208fc1b1cb504086216ae2aa3799.tar.gz scummvm-rg350-1043554591d8208fc1b1cb504086216ae2aa3799.tar.bz2 scummvm-rg350-1043554591d8208fc1b1cb504086216ae2aa3799.zip |
Word wrap the 'features' string
svn-id: r18110
-rw-r--r-- | gui/about.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
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; } |