[gtk/wip/otte/for-master: 2/3] label: Don't deduce label width from logical rect
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/otte/for-master: 2/3] label: Don't deduce label width from logical rect
- Date: Sat, 6 Nov 2021 02:40:56 +0000 (UTC)
commit 222d6f1db181e97e96354a0e2312587934fec16f
Author: Benjamin Otte <otte redhat com>
Date: Sat Nov 6 03:15:04 2021 +0100
label: Don't deduce label width from logical rect
The width of a logical rect after line breaking is sometimes not
wide enough to cause line breaking to break at the exact same points.
(Is that by design or a bug in Pango? I don't know.)
So don't use the width, and only relyon values we actually set to
pango_layout_set_width().
gtk/gtklabel.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index 3580deae1e..3c3be85406 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -1203,7 +1203,7 @@ get_width_for_height (GtkLabel *self,
if (text_height > height)
min = mid + 1;
else
- max = text_width;
+ max = mid;
}
*minimum_width = min;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]