From 6642b7e12c203cba63246d57db760bf9c521769e Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Wed, 10 Apr 2024 18:43:41 +0100 Subject: [PATCH] Temporary fix for click/tooltip alignment of cargo lines in industry chains window See: #681 See: https://github.com/OpenTTD/OpenTTD/issues/12465 --- src/industry_gui.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index 48b4cd0130..ee258ab6c9 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -2354,11 +2354,11 @@ struct CargoesField { } /* col = 0 -> left of first col, 1 -> left of 2nd col, ... this->u.cargo.num_cargoes right of last-col. */ - int vpos = vert_inter_industry_space / 2 + CargoesField::cargo_border.width; + int vpos = (vert_inter_industry_space / 2) + (CargoesField::cargo_border.width / 2); uint row; for (row = 0; row < MAX_CARGOES; row++) { if (pt.y < vpos) return INVALID_CARGO; - if (pt.y < vpos + GetCharacterHeight(FS_NORMAL)) break; + if (pt.y < vpos + (int)CargoesField::cargo_line.height) break; vpos += GetCharacterHeight(FS_NORMAL) + CargoesField::cargo_space.width; } if (row == MAX_CARGOES) return INVALID_CARGO;