[gtk/gtk-4-6: 6/11] gridview: Fix rubberbanding from negative x coordinates




commit 8d771eb26c8e131e84eb5c88bfc48d6a475a0063
Author: Corey Berla <corey berla me>
Date:   Wed Sep 14 11:27:13 2022 -0700

    gridview: Fix rubberbanding from negative x coordinates
    
    This is a follow-up to 1e9a36ffa8d198212cde130a021256fd142ba6c5. For GridView
    we also need to make sure that we aren't rubberbanding below x=0 which
    causes unexpected rubberbanding behavior.
    
    Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/2492

 gtk/gtkgridview.c | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/gtk/gtkgridview.c b/gtk/gtkgridview.c
index fbd3a65327..edff82293d 100644
--- a/gtk/gtkgridview.c
+++ b/gtk/gtkgridview.c
@@ -442,6 +442,8 @@ gtk_grid_view_get_position_from_allocation (GtkListBase           *base,
 
   n_items = gtk_list_base_get_n_items (base);
   along = CLAMP (along, 0, gtk_grid_view_compute_total_height (self) - 1);
+  across = across < 0 ? 0 : across;
+
   if (!gtk_grid_view_get_cell_at_y (self,
                                     along,
                                     &pos,


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