Fix wrong line height in click to select order in timetable GUI

This commit is contained in:
Jonathan G Rennison
2018-08-07 07:47:31 +01:00
parent 9774606c22
commit 59c396cc3b

View File

@@ -258,7 +258,7 @@ struct TimetableWindow : Window {
int GetOrderFromTimetableWndPt(int y, const Vehicle *v) int GetOrderFromTimetableWndPt(int y, const Vehicle *v)
{ {
int sel = (y - this->GetWidget<NWidgetBase>(WID_VT_TIMETABLE_PANEL)->pos_y - WD_FRAMERECT_TOP) / FONT_HEIGHT_NORMAL; int sel = (y - this->GetWidget<NWidgetBase>(WID_VT_TIMETABLE_PANEL)->pos_y - WD_FRAMERECT_TOP) / max<int>(FONT_HEIGHT_NORMAL, GetSpriteSize(SPR_LOCK).height);
if ((uint)sel >= this->vscroll->GetCapacity()) return INVALID_ORDER; if ((uint)sel >= this->vscroll->GetCapacity()) return INVALID_ORDER;