[pango/line-breaker] layout: Fix an oversight
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pango/line-breaker] layout: Fix an oversight
- Date: Mon, 24 Jan 2022 05:31:14 +0000 (UTC)
commit a9ed841a8b76a3701fa0f19878a593a18d96a979
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Jan 24 00:30:40 2022 -0500
layout: Fix an oversight
We were failing to collect the attributes. Oops.
pango/pango-layout.c | 28 ++++++++++++++++++++--------
1 file changed, 20 insertions(+), 8 deletions(-)
---
diff --git a/pango/pango-layout.c b/pango/pango-layout.c
index 286c9aa3..d5b0a9fc 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -524,20 +524,32 @@ get_effective_attributes (PangoLayout *layout)
PangoAttrList *attrs = NULL;
if (layout->font_desc)
- pango_attr_list_insert_before (ensure_attrs (layout, attrs),
- pango_attr_font_desc_new (layout->font_desc));
+ {
+ attrs = ensure_attrs (layout, attrs);
+ pango_attr_list_insert_before (attrs,
+ pango_attr_font_desc_new (layout->font_desc));
+ }
if (layout->line_height != 0.0)
- pango_attr_list_insert_before (ensure_attrs (layout, attrs),
- pango_attr_line_height_new (layout->line_height));
+ {
+ attrs = ensure_attrs (layout, attrs);
+ pango_attr_list_insert_before (attrs,
+ pango_attr_line_height_new (layout->line_height));
+ }
if (layout->spacing != 0)
- pango_attr_list_insert_before (ensure_attrs (layout, attrs),
- pango_attr_line_spacing_new (layout->spacing));
+ {
+ attrs = ensure_attrs (layout, attrs);
+ pango_attr_list_insert_before (attrs,
+ pango_attr_line_spacing_new (layout->spacing));
+ }
if (layout->single_paragraph)
- pango_attr_list_insert_before (ensure_attrs (layout, attrs),
- pango_attr_paragraph_new ());
+ {
+ attrs = ensure_attrs (layout, attrs);
+ pango_attr_list_insert_before (attrs,
+ pango_attr_paragraph_new ());
+ }
if (attrs)
return attrs;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]