[gtk/wip/otte/for-master: 26/26] label: Don't add a pixel where none should be added




commit 899cb445199c45733882f5977468bebfbe33a070
Author: Benjamin Otte <otte redhat com>
Date:   Thu Nov 18 07:54:16 2021 +0100

    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;


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