inscription: Do not try to align layouts that have a proper width set

Pango knows where to put the text.
This commit is contained in:
Benjamin Otte 2022-06-13 04:53:35 +02:00
parent 4927b6e625
commit 883011f252

View File

@ -424,7 +424,10 @@ gtk_inscription_get_layout_location (GtkInscription *self,
xalign = 1.0 - xalign;
pango_layout_get_pixel_extents (self->layout, NULL, &logical);
x = floor ((xalign * (widget_width - logical.width)) - logical.x);
if (pango_layout_get_width (self->layout) > 0)
x = 0.f;
else
x = floor ((xalign * (widget_width - logical.width)) - logical.x);
baseline = gtk_widget_get_allocated_baseline (widget);
if (baseline != -1)