diff options
author | Benjamin Otte <otte@redhat.com> | 2022-06-11 16:28:27 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2022-06-11 16:28:27 +0200 |
commit | 393ef4d0a23053fdfd0445c37af55da72aa66f30 (patch) | |
tree | 6818ad9716e60a19566d2364af7d87264b1d3691 | |
parent | c7c8b37e4c776879a434edbf487bbe22614b1c29 (diff) | |
download | gtk+-393ef4d0a23053fdfd0445c37af55da72aa66f30.tar.gz |
inscription: Fixate layout at top when it doesn't fit
Ellipsized and clipped layouts shouldn't reposition themselves according
to yalign when they don't fully fit.
-rw-r--r-- | gtk/gtkinscription.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gtk/gtkinscription.c b/gtk/gtkinscription.c index 155f334ad8..6a2260027a 100644 --- a/gtk/gtkinscription.c +++ b/gtk/gtkinscription.c @@ -395,9 +395,15 @@ gtk_inscription_get_layout_location (GtkInscription *self, /* yalign is 0 because we can't support yalign while baseline aligning */ y = baseline - layout_baseline; } + else if (pango_layout_is_ellipsized (self->layout)) + { + y = 0.f; + } else { y = floor ((widget_height - logical.height) * self->yalign); + if (y < 0) + y = 0.f; } *x_out = x; |