label: Don't add a pixel where none should be added
authorBenjamin Otte <otte@redhat.com>
Thu, 18 Nov 2021 06:54:16 +0000 (07:54 +0100)
committerBenjamin Otte <otte.benjamin@googlemail.com>
Thu, 18 Nov 2021 07:16:09 +0000 (07:16 +0000)
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

index 41041b3a9eacb06acf83db17bad5822d6dbad235..11ebad9c2d976aeef63eb2b22c4867fc2d465df8 100644 (file)
@@ -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;