From ea33b6979810ebd2e20f11d4bfb1979147b9f248 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Sat, 20 Sep 2014 09:18:22 +0000 Subject: (svn r26856) -Codechange: Ensure company face widgets can fit company face. --- src/company_gui.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/company_gui.cpp b/src/company_gui.cpp index 3a854ccbf..9b0d7e63a 100644 --- a/src/company_gui.cpp +++ b/src/company_gui.cpp @@ -1137,6 +1137,13 @@ public: virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { + case WID_SCMF_FACE: { + Dimension face_size = GetSpriteSize(SPR_GRADIENT); + size->width = max(size->width, face_size.width); + size->height = max(size->height, face_size.height); + break; + } + case WID_SCMF_HAS_MOUSTACHE_EARRING_TEXT: case WID_SCMF_TIE_EARRING_TEXT: { int offset = (widget - WID_SCMF_HAS_MOUSTACHE_EARRING_TEXT) * 2; @@ -2074,6 +2081,13 @@ struct CompanyWindow : Window virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { + case WID_C_FACE: { + Dimension face_size = GetSpriteSize(SPR_GRADIENT); + size->width = max(size->width, face_size.width); + size->height = max(size->height, face_size.height); + break; + } + case WID_C_DESC_COLOUR_SCHEME_EXAMPLE: { Point offset; Dimension d = GetSpriteSize(SPR_VEH_BUS_SW_VIEW, &offset); -- cgit v1.2.3-70-g09d2