From 59c396cc3bc9e76f0c80a07d98a45e51858e3e0c Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Tue, 7 Aug 2018 07:47:31 +0100 Subject: [PATCH] Fix wrong line height in click to select order in timetable GUI --- src/timetable_gui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/timetable_gui.cpp b/src/timetable_gui.cpp index 59dff7882c..856ac71e70 100644 --- a/src/timetable_gui.cpp +++ b/src/timetable_gui.cpp @@ -258,7 +258,7 @@ struct TimetableWindow : Window { int GetOrderFromTimetableWndPt(int y, const Vehicle *v) { - int sel = (y - this->GetWidget(WID_VT_TIMETABLE_PANEL)->pos_y - WD_FRAMERECT_TOP) / FONT_HEIGHT_NORMAL; + int sel = (y - this->GetWidget(WID_VT_TIMETABLE_PANEL)->pos_y - WD_FRAMERECT_TOP) / max(FONT_HEIGHT_NORMAL, GetSpriteSize(SPR_LOCK).height); if ((uint)sel >= this->vscroll->GetCapacity()) return INVALID_ORDER;