1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-28 14:44:28 +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

@@ -248,7 +248,7 @@ struct DropdownWindow : Window {
if (y < item_height) {
if (item->masked || !item->Selectable()) return false;
result = item->result;
click_result = item->OnClick({r.left, 0, r.right, item_height - 1}, {_cursor.pos.x - this->left, y});
click_result = item->OnClick(r.WithY(0, item_height - 1), {_cursor.pos.x - this->left, y});
return true;
}
@@ -274,7 +274,7 @@ struct DropdownWindow : Window {
if (--pos >= 0) continue;
if (y + item_height - 1 <= ir.bottom) {
Rect full{ir.left, y, ir.right, y + item_height - 1};
Rect full = ir.WithY(y, y + item_height - 1);
bool selected = (this->selected_result == item->result) && item->Selectable();
if (selected) GfxFillRect(full, PC_BLACK);