mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-28 01:04:50 +01:00
Fix #21498: Crash when the size of text can’t be determined
This commit is contained in:
@@ -68,7 +68,7 @@ static void PaintBannerScrollingText(
|
||||
}
|
||||
|
||||
auto stringWidth = GfxGetStringWidth(text, FontStyle::Tiny);
|
||||
auto scroll = (GetGameState().CurrentTicks / 2) % stringWidth;
|
||||
auto scroll = stringWidth > 0 ? (GetGameState().CurrentTicks / 2) % stringWidth : 0;
|
||||
auto imageId = ScrollingTextSetup(session, STR_BANNER_TEXT_FORMAT, ft, scroll, scrollingMode, COLOUR_BLACK);
|
||||
PaintAddImageAsChild(session, imageId, { 0, 0, height + 22 }, { bbOffset, { 1, 1, 21 } });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user