MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / UpdateWidgetSize

Method UpdateWidgetSize

src/company_gui.cpp:1306–1323  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1304 }
1305
1306 void UpdateWidgetSize(WidgetID widget, Dimension &size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension &fill, [[maybe_unused]] Dimension &resize) override
1307 {
1308 switch (widget) {
1309 case WID_SCMF_FACE:
1310 size = maxdim(size, GetScaledSpriteSize(SPR_GRADIENT));
1311 break;
1312
1313 case WID_SCMF_STYLE:
1314 size.height = this->line_height;
1315 break;
1316
1317 case WID_SCMF_PARTS:
1318 fill.height = resize.height = this->line_height;
1319 size.width = GetMaximumFacePartsWidth();
1320 size.height = resize.height * 5;
1321 break;
1322 }
1323 }
1324
1325 void DrawWidget(const Rect &r, WidgetID widget) const override
1326 {

Callers

nothing calls this directly

Calls 2

maxdimFunction · 0.85
GetScaledSpriteSizeFunction · 0.85

Tested by

no test coverage detected