forked from mirror/OpenTTD
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:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user