[gtk/wip/otte/listview: 5/15] listbase: Compare with the right adjustment




commit ed85d4d39229bd2b2041cbf6e90a5d10f84a85ff
Author: Benjamin Otte <otte redhat com>
Date:   Sun Feb 13 04:39:08 2022 +0100

    listbase: Compare with the right adjustment
    
    We want to keep the adjustment in place that is *not* scrolled, not the
    one that is.

 gtk/gtklistbase.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtklistbase.c b/gtk/gtklistbase.c
index 7547bafcca..1014de43c7 100644
--- a/gtk/gtklistbase.c
+++ b/gtk/gtklistbase.c
@@ -187,7 +187,7 @@ gtk_list_base_adjustment_value_changed_cb (GtkAdjustment *adjustment,
   gtk_list_base_get_adjustment_values (self, OPPOSITE_ORIENTATION (priv->orientation), &area.x, &total_size, 
&area.width);
   if (total_size == area.width)
     align_across = 0.5;
-  else if (adjustment != priv->adjustment[priv->orientation])
+  else if (adjustment != priv->adjustment[OPPOSITE_ORIENTATION(priv->orientation)])
     align_across = CLAMP (priv->anchor_align_across, 0, 1);
   else
     align_across = (double) area.x / (total_size - area.width);
@@ -197,7 +197,7 @@ gtk_list_base_adjustment_value_changed_cb (GtkAdjustment *adjustment,
   gtk_list_base_get_adjustment_values (self, priv->orientation, &area.y, &total_size, &area.height);
   if (total_size == area.height)
     align_along = 0.5;
-  else if (adjustment != priv->adjustment[OPPOSITE_ORIENTATION(priv->orientation)])
+  else if (adjustment != priv->adjustment[priv->orientation])
     align_along = CLAMP (priv->anchor_align_along, 0, 1);
   else
     align_along = (double) area.y / (total_size - area.height);


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