diff options
author | Tobia Tesan | 2013-09-20 14:04:20 +0200 |
---|---|---|
committer | Tobia Tesan | 2013-09-21 23:22:27 +0200 |
commit | 1361fcde7c0cf0cecb6896288465551d1eb195f9 (patch) | |
tree | dfdce0469741b3443ea92e57adf73046d92fce1b /engines/wintermute/ad | |
parent | 91ebad46d3adc4cf48a14f0f1bbfa9e41e28ecad (diff) | |
download | scummvm-rg350-1361fcde7c0cf0cecb6896288465551d1eb195f9.tar.gz scummvm-rg350-1361fcde7c0cf0cecb6896288465551d1eb195f9.tar.bz2 scummvm-rg350-1361fcde7c0cf0cecb6896288465551d1eb195f9.zip |
WINTERMUTE: Avoid feeding setWidth negative values
Diffstat (limited to 'engines/wintermute/ad')
-rw-r--r-- | engines/wintermute/ad/ad_response_box.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/engines/wintermute/ad/ad_response_box.cpp b/engines/wintermute/ad/ad_response_box.cpp index 6d513eb851..f9680e99df 100644 --- a/engines/wintermute/ad/ad_response_box.cpp +++ b/engines/wintermute/ad/ad_response_box.cpp @@ -182,10 +182,12 @@ bool AdResponseBox::createButtons() { btn->putFont(_responses[i]->getFont()); } - btn->setWidth(_responseArea.right - _responseArea.left); - if (btn->getWidth() <= 0) { - // TODO: This is not very pretty. Should do it at setWidth level, heh? + int width = _responseArea.right - _responseArea.left; + + if (width <= 0) { btn->setWidth(_gameRef->_renderer->getWidth()); + } else { + btn->setWidth(width); } } btn->setName("response"); |