gridview: Allow starting rubberband in empty space below last row

Rubberband does not work when initiated past the last row
(warning is printed "Could not start rubberbanding: No item).

Clamp y at the max height of the widgets in the gridview

Fixes: #3462
This commit is contained in:
Corey Berla 2022-07-25 15:35:20 -07:00
parent c6f357e447
commit 1e9a36ffa8

View File

@ -441,6 +441,7 @@ gtk_grid_view_get_position_from_allocation (GtkListBase *base,
return FALSE;
n_items = gtk_list_base_get_n_items (base);
along = CLAMP (along, 0, gtk_grid_view_compute_total_height (self) - 1);
if (!gtk_grid_view_get_cell_at_y (self,
along,
&pos,