src/timetable_gui.cpp
changeset 10093 687ec810f0a1
parent 9778 c5dd94ed7c16
child 10145 849ba8b8626b
equal deleted inserted replaced
10092:63288485ca37 10093:687ec810f0a1
    71 
    71 
    72 		if ((uint)sel >= this->vscroll.cap) return INVALID_ORDER;
    72 		if ((uint)sel >= this->vscroll.cap) return INVALID_ORDER;
    73 
    73 
    74 		sel += this->vscroll.pos;
    74 		sel += this->vscroll.pos;
    75 
    75 
    76 		return (sel <= v->num_orders * 2 && sel >= 0) ? sel : INVALID_ORDER;
    76 		return (sel < v->num_orders * 2 && sel >= 0) ? sel : INVALID_ORDER;
    77 	}
    77 	}
    78 
    78 
    79 	void OnPaint()
    79 	void OnPaint()
    80 	{
    80 	{
    81 		const Vehicle *v = GetVehicle(this->window_number);
    81 		const Vehicle *v = GetVehicle(this->window_number);