GetScrolled*FromWidget took line height from the widget's resize_y value, however not all widgets are resizable, resulting in a division-by-zero. Allow passing line height explicitly in cases where a widget is not resizable.
This commit is contained in:
@@ -501,7 +501,7 @@ public:
|
||||
break;
|
||||
|
||||
case WID_AP_AIRPORT_LIST: {
|
||||
int num_clicked = this->vscroll->GetScrolledRowFromWidget(pt.y, this, widget);
|
||||
int num_clicked = this->vscroll->GetScrolledRowFromWidget(pt.y, this, widget, 0, this->line_height);
|
||||
if (num_clicked == INT_MAX) break;
|
||||
const AirportSpec *as = AirportClass::Get(_selected_airport_class)->GetSpec(num_clicked);
|
||||
if (as->IsAvailable()) this->SelectOtherAirport(num_clicked);
|
||||
|
Reference in New Issue
Block a user