diff options
author | Matthias Clasen <mclasen@redhat.com> | 2021-09-01 21:36:48 +0000 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2021-09-01 21:36:48 +0000 |
commit | c1ae75e06b176a73f2d7da46b0923fc8cb22d60b (patch) | |
tree | 6d201fcb3feca60159217e04d57ac54cd4aec5b7 /pango/pango-layout.c | |
parent | 6b7d85480653f83c5f5605bf99582d04d721fbb5 (diff) | |
parent | dd21621c1bba8121151c6828abbb68ef403c7d76 (diff) | |
download | pango-c1ae75e06b176a73f2d7da46b0923fc8cb22d60b.tar.gz |
Merge branch 'matthiasc/for-main' into 'main'
Be more forgiving about attribute ordering
See merge request GNOME/pango!468
Diffstat (limited to 'pango/pango-layout.c')
-rw-r--r-- | pango/pango-layout.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/pango/pango-layout.c b/pango/pango-layout.c index 098e3a3e..21e2c9c6 100644 --- a/pango/pango-layout.c +++ b/pango/pango-layout.c @@ -6248,20 +6248,26 @@ collect_baseline_shift (ParaBreakState *state, if (attr->end_index == item->offset + item->length) { - BaselineItem *entry = state->baseline_shifts->data; + GList *t; - if (attr->start_index == entry->attr->start_index && - attr->end_index == entry->attr->end_index && - ((PangoAttrInt *)attr)->value == ((PangoAttrInt *)entry->attr)->value) + for (t = state->baseline_shifts; t; t = t->next) { - *end_x_offset -= entry->x_offset; - *end_y_offset -= entry->y_offset; + BaselineItem *entry = t->data; + + if (attr->start_index == entry->attr->start_index && + attr->end_index == entry->attr->end_index && + ((PangoAttrInt *)attr)->value == ((PangoAttrInt *)entry->attr)->value) + { + *end_x_offset -= entry->x_offset; + *end_y_offset -= entry->y_offset; + } + + state->baseline_shifts = g_list_remove (state->baseline_shifts, entry); + g_free (entry); + break; } - else + if (t == NULL) g_warning ("Baseline attributes mismatch\n"); - - state->baseline_shifts = g_list_remove (state->baseline_shifts, entry); - g_free (entry); } } } |