From 8f17db9b4a00a6edf53d75f5ff2496d275c4056d Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Fri, 22 Mar 2013 12:00:00 +0100 Subject: [PATCH] GtkButton: Fix y displacement with baseline alignment We need to shift down the baseline too when displacing y. --- gtk/gtkbutton.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c index 5165ba4dd9..d0b5711c35 100644 --- a/gtk/gtkbutton.c +++ b/gtk/gtkbutton.c @@ -1651,6 +1651,10 @@ gtk_button_size_allocate (GtkWidget *widget, child_allocation.height = child_allocation.height - (focus_width + focus_pad) * 2; } + baseline = gtk_widget_get_allocated_baseline (widget); + if (baseline != -1) + baseline -= child_allocation.y - allocation->y; + if (priv->depressed) { gint child_displacement_x; @@ -1667,9 +1671,6 @@ gtk_button_size_allocate (GtkWidget *widget, child_allocation.width = MAX (1, child_allocation.width); child_allocation.height = MAX (1, child_allocation.height); - baseline = gtk_widget_get_allocated_baseline (widget); - if (baseline != -1) - baseline -= child_allocation.y - allocation->y; gtk_widget_size_allocate_with_baseline (child, &child_allocation, baseline); } }