gridview: Fix get_items_in_rect() selection

last_row should be dependent on y + height, not y
This commit is contained in:
Corey Berla 2022-07-25 17:16:56 -07:00
parent 1e9a36ffa8
commit ba909cf901

View File

@ -490,7 +490,7 @@ gtk_grid_view_get_items_in_rect (GtkListBase *base,
if (!gtk_grid_view_get_cell_at_y (self, rect->y, &first_row, NULL, NULL)) if (!gtk_grid_view_get_cell_at_y (self, rect->y, &first_row, NULL, NULL))
first_row = rect->y < 0 ? 0 : n_items - 1; first_row = rect->y < 0 ? 0 : n_items - 1;
if (!gtk_grid_view_get_cell_at_y (self, rect->y + rect->height, &last_row, NULL, NULL)) if (!gtk_grid_view_get_cell_at_y (self, rect->y + rect->height, &last_row, NULL, NULL))
last_row = rect->y < 0 ? 0 : n_items - 1; last_row = rect->y + rect->height < 0 ? 0 : n_items - 1;
gtk_bitset_add_rectangle (result, gtk_bitset_add_rectangle (result,
first_row + first_column, first_row + first_column,