Codechange: Replace Rect CentreTo with CentreToHeight. (#14675)

So far all callers only need to centre vertically, so not having to provide the existing width simplifies calls.
This commit is contained in:
Peter Nelson
2025-09-28 14:09:36 +01:00
committed by dP
parent de0b4b4918
commit d50dd18215
7 changed files with 16 additions and 19 deletions
+1 -2
View File
@@ -1419,8 +1419,7 @@ struct GenerateProgressWindow : public Window {
DrawFrameRect(r, COLOUR_GREY, {FrameFlag::BorderOnly, FrameFlag::Lowered});
Rect br = r.Shrink(WidgetDimensions::scaled.bevel);
DrawFrameRect(br.WithWidth(br.Width() * GenWorldStatus::percent / 100, _current_text_dir == TD_RTL), COLOUR_MAUVE, {});
DrawString(br.left, br.right, CentreBounds(br.top, br.bottom, GetCharacterHeight(FS_NORMAL)),
GetString(STR_GENERATION_PROGRESS, GenWorldStatus::percent), TC_FROMSTRING, SA_HOR_CENTER);
DrawString(br.CentreToHeight(GetCharacterHeight(FS_NORMAL)), GetString(STR_GENERATION_PROGRESS, GenWorldStatus::percent), TC_FROMSTRING, SA_HOR_CENTER);
break;
}