Fix: Settings GUI sprite size.

This commit is contained in:
Peter Nelson 2022-09-27 22:39:35 +01:00 committed by PeterN
parent 123983743f
commit 61da064b82

View File

@ -1933,7 +1933,6 @@ struct GameSettingsWindow : Window {
this->filter.type_hides = false; this->filter.type_hides = false;
this->settings_ptr = &GetGameSettings(); this->settings_ptr = &GetGameSettings();
_circle_size = maxdim(GetSpriteSize(SPR_CIRCLE_FOLDED), GetSpriteSize(SPR_CIRCLE_UNFOLDED));
GetSettingsTree().FoldAll(); // Close all sub-pages GetSettingsTree().FoldAll(); // Close all sub-pages
this->valuewindow_entry = nullptr; // No setting entry for which a entry window is opened this->valuewindow_entry = nullptr; // No setting entry for which a entry window is opened
@ -1954,6 +1953,11 @@ struct GameSettingsWindow : Window {
this->InvalidateData(); this->InvalidateData();
} }
void OnInit() override
{
_circle_size = maxdim(GetSpriteSize(SPR_CIRCLE_FOLDED), GetSpriteSize(SPR_CIRCLE_UNFOLDED));
}
void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override
{ {
switch (widget) { switch (widget) {