aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/wintermute/ad/ad_response_box.cpp8
-rw-r--r--engines/wintermute/ui/ui_object.cpp6
2 files changed, 7 insertions, 7 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");
diff --git a/engines/wintermute/ui/ui_object.cpp b/engines/wintermute/ui/ui_object.cpp
index e4bcb2aa6b..0824f1f9bd 100644
--- a/engines/wintermute/ui/ui_object.cpp
+++ b/engines/wintermute/ui/ui_object.cpp
@@ -657,14 +657,12 @@ int32 UIObject::getHeight() {
}
void UIObject::setWidth(int32 width) {
- // assert (width >= 0);
- // This would be ideal, but ATM must be failing pretty much everywhere.
+ assert (width >= 0);
_width = width;
}
void UIObject::setHeight(int32 height) {
- // assert (height >= 0);
- // This would be ideal, but ATM must be failing pretty much everywhere.
+ assert (height >= 0);
_height = height;
}