From 899cb445199c45733882f5977468bebfbe33a070 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Thu, 18 Nov 2021 07:54:16 +0100 Subject: [PATCH] label: Don't add a pixel where none should be added When the text width is larger than the measuring width, set the min width to that value, don't also add 1 to it. --- gtk/gtklabel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c index 41041b3a9e..11ebad9c2d 100644 --- a/gtk/gtklabel.c +++ b/gtk/gtklabel.c @@ -1201,7 +1201,7 @@ get_width_for_height (GtkLabel *self, text_width = PANGO_PIXELS_CEIL (text_width); if (text_width > mid) min = mid = text_width; - if (text_height > height) + else if (text_height > height) min = mid + 1; else max = mid;