diff options
author | peter1138 <peter1138@openttd.org> | 2014-09-20 09:18:22 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2014-09-20 09:18:22 +0000 |
commit | ea33b6979810ebd2e20f11d4bfb1979147b9f248 (patch) | |
tree | a937b499208f4fe78a66a2f0301841527dda2551 | |
parent | 0f978d0ad4cf57c4151bb2138faceb0212f0adb0 (diff) | |
download | openttd-ea33b6979810ebd2e20f11d4bfb1979147b9f248.tar.xz |
(svn r26856) -Codechange: Ensure company face widgets can fit company face.
-rw-r--r-- | src/company_gui.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
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); |