mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-09 23:50:25 +00:00
Codechange: Use maxdim instead of setting width/height separately. (#11535)
This commit is contained in:
parent
aae6e0481e
commit
17c3ce8632
@ -1466,12 +1466,9 @@ public:
|
||||
*size = maxdim(*size, GetStringBoundingBox(STR_FACE_MOUSTACHE));
|
||||
break;
|
||||
|
||||
case WID_SCMF_FACE: {
|
||||
Dimension face_size = GetScaledSpriteSize(SPR_GRADIENT);
|
||||
size->width = std::max(size->width, face_size.width);
|
||||
size->height = std::max(size->height, face_size.height);
|
||||
case WID_SCMF_FACE:
|
||||
*size = maxdim(*size, GetScaledSpriteSize(SPR_GRADIENT));
|
||||
break;
|
||||
}
|
||||
|
||||
case WID_SCMF_HAS_MOUSTACHE_EARRING:
|
||||
case WID_SCMF_HAS_GLASSES:
|
||||
@ -2323,12 +2320,9 @@ struct CompanyWindow : Window
|
||||
void UpdateWidgetSize(int widget, Dimension *size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension *fill, [[maybe_unused]] Dimension *resize) override
|
||||
{
|
||||
switch (widget) {
|
||||
case WID_C_FACE: {
|
||||
Dimension face_size = GetScaledSpriteSize(SPR_GRADIENT);
|
||||
size->width = std::max(size->width, face_size.width);
|
||||
size->height = std::max(size->height, face_size.height);
|
||||
case WID_C_FACE:
|
||||
*size = maxdim(*size, GetScaledSpriteSize(SPR_GRADIENT));
|
||||
break;
|
||||
}
|
||||
|
||||
case WID_C_DESC_COLOUR_SCHEME_EXAMPLE: {
|
||||
Point offset;
|
||||
|
@ -8,6 +8,7 @@
|
||||
/** @file error_gui.cpp GUI related to errors. */
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "core/geometry_func.hpp"
|
||||
#include "core/mem_func.hpp"
|
||||
#include "landscape.h"
|
||||
#include "newgrf_text.h"
|
||||
@ -208,12 +209,9 @@ public:
|
||||
size->height = std::max(size->height, panel_height);
|
||||
break;
|
||||
}
|
||||
case WID_EM_FACE: {
|
||||
Dimension face_size = GetScaledSpriteSize(SPR_GRADIENT);
|
||||
size->width = std::max(size->width, face_size.width);
|
||||
size->height = std::max(size->height, face_size.height);
|
||||
case WID_EM_FACE:
|
||||
*size = maxdim(*size, GetScaledSpriteSize(SPR_GRADIENT));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user