Merge branch 'grid-scroll-crash' into 'main'

gtkgridview: Fix crash on scroll to 0 sized tile

Closes #5945

See merge request GNOME/gtk!6228
This commit is contained in:
Benjamin Otte 2023-08-06 17:56:57 +00:00
commit 1e6a95aa1b

View File

@ -411,7 +411,7 @@ gtk_grid_view_get_position_from_allocation (GtkListBase *base,
} }
pos = gtk_list_tile_get_position (self->item_manager, tile); pos = gtk_list_tile_get_position (self->item_manager, tile);
if (tile->n_items > 1) if (tile->n_items > 1 && tile->area.width > 0 && tile->area.height > 0)
{ {
int xspacing, yspacing; int xspacing, yspacing;