summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2022-07-03 15:12:12 +0000
committerMatthias Clasen <mclasen@redhat.com>2022-07-03 15:12:12 +0000
commitf691d511c96bdf7efb1535e45d850b5474d45767 (patch)
tree8155e6011f10e329e467a1dc0cc599338256ae68
parent641d8a2b056621fd1f1d5d58e6a9e4dbdfe8e7ae (diff)
parentb054282fa39c6fc664796da72a612005332c9ce8 (diff)
downloadpango-f691d511c96bdf7efb1535e45d850b5474d45767.tar.gz
Merge branch 'matthiasc/for-main' into 'main'
layout: Apply show flags to line separators See merge request GNOME/pango!632
-rw-r--r--pango/pango-layout.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/pango/pango-layout.c b/pango/pango-layout.c
index 165c6a7f..065f85a1 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -6186,6 +6186,23 @@ add_missing_hyphen (PangoLayoutLine *line,
}
}
+static PangoShowFlags
+find_show_flags (const PangoAnalysis *analysis)
+{
+ GSList *l;
+ PangoShowFlags flags = 0;
+
+ for (l = analysis->extra_attrs; l; l = l->next)
+ {
+ PangoAttribute *attr = l->data;
+
+ if (attr->klass->type == PANGO_ATTR_SHOW)
+ flags |= ((PangoAttrInt*)attr)->value;
+ }
+
+ return flags;
+}
+
static void
zero_line_final_space (PangoLayoutLine *line,
ParaBreakState *state,
@@ -6201,8 +6218,15 @@ zero_line_final_space (PangoLayoutLine *line,
if (glyphs->glyphs[glyph].glyph == PANGO_GET_UNKNOWN_GLYPH (0x2028))
{
- DEBUG1 ("zero final space: visible space");
- return; /* this LS is visible */
+ PangoShowFlags show_flags;
+
+ show_flags = find_show_flags (&item->analysis);
+
+ if ((show_flags & PANGO_SHOW_LINE_BREAKS) != 0)
+ {
+ DEBUG1 ("zero final space: visible space");
+ return; /* this LS is visible */
+ }
}
/* if the final char of line forms a cluster, and it's