summaryrefslogtreecommitdiff
path: root/src/widget.cpp
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2014-09-20 00:27:14 +0000
committerpeter1138 <peter1138@openttd.org>2014-09-20 00:27:14 +0000
commit41054e73fdcb05c895a1d50ee56187021b31203c (patch)
treea871739de51fd43faf57965db3212806b34def0d /src/widget.cpp
parent79ca66eb673c710432d1f4e51af70730a09a82c8 (diff)
downloadopenttd-41054e73fdcb05c895a1d50ee56187021b31203c.tar.xz
(svn r26854) -Codechange: Don't override computed minimal size with static minimal size, instead only increase it.
Diffstat (limited to 'src/widget.cpp')
-rw-r--r--src/widget.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/widget.cpp b/src/widget.cpp
index 77d163c81..b506ce71d 100644
--- a/src/widget.cpp
+++ b/src/widget.cpp
@@ -805,8 +805,8 @@ NWidgetResizeBase::NWidgetResizeBase(WidgetType tp, uint fill_x, uint fill_y) :
*/
void NWidgetResizeBase::SetMinimalSize(uint min_x, uint min_y)
{
- this->min_x = min_x;
- this->min_y = min_y;
+ this->min_x = max(this->min_x, min_x);
+ this->min_y = max(this->min_y, min_y);
}
/**
@@ -2100,7 +2100,8 @@ NWidgetLeaf::NWidgetLeaf(WidgetType tp, Colours colour, int index, uint16 data,
{
assert(index >= 0 || tp == WWT_LABEL || tp == WWT_TEXT || tp == WWT_CAPTION || tp == WWT_RESIZEBOX || tp == WWT_SHADEBOX || tp == WWT_DEFSIZEBOX || tp == WWT_DEBUGBOX || tp == WWT_STICKYBOX || tp == WWT_CLOSEBOX);
if (index >= 0) this->SetIndex(index);
- this->SetMinimalSize(0, 0);
+ this->min_x = 0;
+ this->min_y = 0;
this->SetResize(0, 0);
switch (tp) {