Codechange: Add version of DrawStringMultiLine that performs clipping test. (#14189)

Normally DrawStringMultiLine does not perform any clipping, as the return value may be needed if it the text is not drawn.

In some specific cases the height is already known, so it is possible to test for clipping, which can cut down on layouting time for text which won't be visible.
This commit is contained in:
2025-05-02 22:59:55 +01:00
committed by GitHub
parent 2f020abe74
commit 8b14faaa40
8 changed files with 53 additions and 12 deletions

View File

@@ -928,7 +928,7 @@ struct GameOptionsWindow : Window {
/* Draw the 'some search results are hidden' notice. */
if (this->warn_missing != WHR_NONE) {
DrawStringMultiLine(panel.WithHeight(this->warn_lines * GetCharacterHeight(FS_NORMAL)),
DrawStringMultiLineWithClipping(panel.WithHeight(this->warn_lines * GetCharacterHeight(FS_NORMAL)),
GetString(warn_str, _game_settings_restrict_dropdown[this->filter.min_cat]),
TC_BLACK, SA_CENTER);
}