From 0a4c08a7be1992845a41c74341756924bf5366d3 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Mon, 13 Jun 2022 04:54:19 +0200 Subject: [PATCH] inscription: Multiparagraph text is always multiline Wrap this text and clip towards the bottom, no matter how high the inscription is. --- gtk/gtkinscription.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/gtk/gtkinscription.c b/gtk/gtkinscription.c index a06b78b30b..f44937fa69 100644 --- a/gtk/gtkinscription.c +++ b/gtk/gtkinscription.c @@ -476,7 +476,17 @@ gtk_inscription_allocate (GtkWidget *widget, PangoRectangle rect; pango_layout_iter_get_line_extents (iter, NULL, &rect); if (rect.y + rect.height > height * PANGO_SCALE) - pango_layout_set_width (self->layout, -1); + { + while (!pango_layout_line_is_paragraph_start (pango_layout_iter_get_line_readonly (iter))) + { + if (!pango_layout_iter_next_line (iter)) + break; + } + if (!pango_layout_line_is_paragraph_start (pango_layout_iter_get_line_readonly (iter))) + { + pango_layout_set_width (self->layout, -1); + } + } } } break;