1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-24 00:03:11 +01:00

Fix invalidation issue with title version strings (#22317)

This commit is contained in:
Aaron van Geffen
2024-07-16 22:40:54 +02:00
committed by GitHub
parent a3ea3a70c5
commit 48d65627f8

View File

@@ -19,6 +19,8 @@ namespace OpenRCT2::Ui::Windows
static constexpr int32_t WW = 500; static constexpr int32_t WW = 500;
static constexpr int32_t WH = 30; static constexpr int32_t WH = 30;
static constexpr uint8_t kTextOffset = 8;
static Widget _widgets[] = { static Widget _widgets[] = {
kWidgetsEnd, kWidgetsEnd,
}; };
@@ -40,7 +42,7 @@ namespace OpenRCT2::Ui::Windows
// Write platform information // Write platform information
constexpr const char platformInfo[] = OPENRCT2_PLATFORM " (" OPENRCT2_ARCHITECTURE ")"; constexpr const char platformInfo[] = OPENRCT2_PLATFORM " (" OPENRCT2_ARCHITECTURE ")";
DrawText(dpi, windowPos + ScreenCoordsXY(0, kListRowHeight), { whiteOutline }, platformInfo); DrawText(dpi, windowPos + ScreenCoordsXY(0, kListRowHeight), { whiteOutline }, platformInfo);
width = std::max<int16_t>(width, GfxGetStringWidth(platformInfo, FontStyle::Medium)); width = std::max<int16_t>(width, GfxGetStringWidth(platformInfo, FontStyle::Medium)) + kTextOffset;
} }
}; };
@@ -50,7 +52,7 @@ namespace OpenRCT2::Ui::Windows
if (window == nullptr) if (window == nullptr)
{ {
window = WindowCreate<TitleVersionWindow>( window = WindowCreate<TitleVersionWindow>(
WindowClass::TitleVersion, ScreenCoordsXY(8, ContextGetHeight() - 30), WW, WH, WindowClass::TitleVersion, ScreenCoordsXY(kTextOffset, ContextGetHeight() - 30), WW, WH,
WF_STICK_TO_BACK | WF_TRANSPARENT); WF_STICK_TO_BACK | WF_TRANSPARENT);
} }
return window; return window;