Fix: Drag drop line position when dragging NewGRF from file to active panel (#14316)

This commit is contained in:
Jonathan G Rennison
2025-06-05 19:09:51 +01:00
committed by GitHub
parent 48764b0fed
commit 7dcc932d44

View File

@@ -863,7 +863,7 @@ struct NewGRFWindow : public Window, NewGRFScanCallback {
/* Get index of current selection. */
int active_sel_pos = this->GetCurrentActivePosition();
if (active_sel_pos != this->active_over) {
uint top = this->active_over < active_sel_pos ? tr.top + 1 : tr.top + step_height - 2;
uint top = (active_sel_pos < 0 || this->active_over < active_sel_pos) ? tr.top + 1 : tr.top + step_height - 2;
GfxFillRect(tr.left, top - 1, tr.right, top + 1, PC_GREY);
}
}