From 41054e73fdcb05c895a1d50ee56187021b31203c Mon Sep 17 00:00:00 2001 From: peter1138 Date: Sat, 20 Sep 2014 00:27:14 +0000 Subject: (svn r26854) -Codechange: Don't override computed minimal size with static minimal size, instead only increase it. --- src/widget.cpp | 7 ++++--- 1 file 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) { -- cgit v1.2.3-70-g09d2