[gtk: 10/11] listview: Fix selection for last item in get_items_in_rect




commit a7bbc258519d3e03a851b1ed7e2cdc5728a8a418
Author: Corey Berla <corey berla me>
Date:   Mon Jul 25 17:01:28 2022 -0700

    listview: Fix selection for last item in get_items_in_rect
    
    Make the last item dependent on y + height

 gtk/gtklistview.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gtk/gtklistview.c b/gtk/gtklistview.c
index 244633fb96..b81ad3f23a 100644
--- a/gtk/gtklistview.c
+++ b/gtk/gtklistview.c
@@ -393,7 +393,7 @@ gtk_list_view_get_items_in_rect (GtkListBase                 *base,
   if (row)
     last = gtk_list_item_manager_get_item_position (self->item_manager, row);
   else
-    last = rect->y < 0 ? 0 : n_items - 1;
+    last = rect->y + rect->height < 0 ? 0 : n_items - 1;
 
   gtk_bitset_add_range_closed (result, first, last);
   return result;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]