diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 3ed9cff86b..98fdf53d46 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -18,6 +18,7 @@ - Fix: [#5210] Default system dialog not accessible from saving landscape window. - Fix: [#6134] Scenarios incorrectly categorised when using Polish version of RCT2. - Fix: [#6141] CSS50.dat is never loaded. +- Fix: [#6647] Changelog window causes FPS drop. - Fix: [#6938] Banner do not correctly capitalise non-ASCII characters. - Fix: [#7176] Mechanics sometimes fall down from rides. - Fix: [#7303] Visual glitch with virtual floor near map edges. diff --git a/src/openrct2-ui/windows/Changelog.cpp b/src/openrct2-ui/windows/Changelog.cpp index 4e8fba9aaa..964d237cfe 100644 --- a/src/openrct2-ui/windows/Changelog.cpp +++ b/src/openrct2-ui/windows/Changelog.cpp @@ -170,7 +170,9 @@ static void window_changelog_scrollgetsize( [[maybe_unused]] rct_window * w, [[maybe_unused]] sint32 scrollIndex, sint32 * width, sint32 * height) { *width = _changelogLongestLineWidth + 4; - *height = (sint32)(_changelogLines.size() * 11); + + const sint32 lineHeight = font_get_line_height(gCurrentFontSpriteBase); + *height = (sint32)(_changelogLines.size() * lineHeight); } static void window_changelog_invalidate(rct_window *w) @@ -196,12 +198,17 @@ static void window_changelog_scrollpaint(rct_window * w, rct_drawpixelinfo * dpi gCurrentFontFlags = 0; gCurrentFontSpriteBase = FONT_SPRITE_BASE_MEDIUM; + const sint32 lineHeight = font_get_line_height(gCurrentFontSpriteBase); + sint32 x = 3; - sint32 y = 3; + sint32 y = 3 - lineHeight; for (auto line : _changelogLines) { + y += lineHeight; + if (y + lineHeight < dpi->y || y >= dpi->y + dpi->height) + continue; + gfx_draw_string(dpi, (char *)line, w->colours[0], x, y); - y += 11; } }