aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorTorbjörn Andersson2006-01-29 13:14:04 +0000
committerTorbjörn Andersson2006-01-29 13:14:04 +0000
commitf881fc47c768d20656f5e9e8c051fb09830830d6 (patch)
tree690676389cb26e934254f6b10e17c422598de3bc /gui
parentf509762f997bd84ec161c3b43590979f9f5be55d (diff)
downloadscummvm-rg350-f881fc47c768d20656f5e9e8c051fb09830830d6.tar.gz
scummvm-rg350-f881fc47c768d20656f5e9e8c051fb09830830d6.tar.bz2
scummvm-rg350-f881fc47c768d20656f5e9e8c051fb09830830d6.zip
Limit the maximum line width.
svn-id: r20296
Diffstat (limited to 'gui')
-rw-r--r--gui/ListWidget.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/gui/ListWidget.cpp b/gui/ListWidget.cpp
index 82f92d81a5..f590edf889 100644
--- a/gui/ListWidget.cpp
+++ b/gui/ListWidget.cpp
@@ -347,9 +347,11 @@ void ListWidget::drawWidget(bool hilite) {
int maxWidth = _textWidth[i];
buffer = _list[pos];
deltax = 0;
- if (_selectedItem != pos)
+ if (_selectedItem != pos) {
width = g_gui.getStringWidth(buffer);
- else
+ if (width > _w - r.left - 2)
+ width = _w - r.left - 2;
+ } else
width = _w - r.left - 2;
if (width > maxWidth)
maxWidth = width;