label: Another tweak to wrapping handling

This fixes a few reftests that were failing after
the previous change because they ended up with x == -1.
This commit is contained in:
Matthias Clasen 2023-08-02 14:50:03 +00:00 committed by Emmanuele Bassi
parent 09be7f65d5
commit a51003661e

View File

@ -1333,10 +1333,9 @@ get_layout_location (GtkLabel *self,
xalign = 1.0 - xalign;
pango_layout_get_pixel_extents (self->layout, NULL, &logical);
if (pango_layout_get_width (self->layout) > 0)
x = floor ((xalign * (widget_width - logical.width)) - logical.x);
if (x < 0)
x = 0.f;
else
x = floor ((xalign * (widget_width - logical.width)) - logical.x);
baseline = gtk_widget_get_baseline (widget);
if (baseline != -1)