[gtk/wip/otte/listview: 2/9] listbase: Compare with the right adjustment
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/otte/listview: 2/9] listbase: Compare with the right adjustment
- Date: Sun, 13 Feb 2022 23:39:31 +0000 (UTC)
commit 0792f519bffbc92e68efab59af244688c7698c2d
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]