1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-22 03:42:41 +01:00

Codechange: Use Rect WithX/WithY in some places.

This commit is contained in:
Peter Nelson
2025-09-21 20:35:58 +01:00
committed by Peter Nelson
parent 6d3f39609f
commit 31eec7106b
11 changed files with 29 additions and 27 deletions

View File

@@ -833,7 +833,7 @@ Rect QueryString::GetBoundingRect(const Window *w, WidgetID wid, size_t from, si
const auto p1 = GetCharPosInString(tb->GetText(), from, FS_NORMAL);
const auto p2 = from != to ? GetCharPosInString(tb->GetText(), to, FS_NORMAL) : p1;
return { Clamp(r.left + p1.left, r.left, r.right), r.top, Clamp(r.left + p2.right, r.left, r.right), r.bottom };
return r.WithX(Clamp(r.left + p1.left, r.left, r.right), Clamp(r.left + p2.right, r.left, r.right));
}
/**