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.
This commit is contained in:
Benjamin Otte 2021-11-18 07:54:16 +01:00 committed by Benjamin Otte
parent 86175f043c
commit 899cb44519

View 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;