diff options
author | Matthias Clasen <mclasen@redhat.com> | 2014-09-02 18:18:21 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2014-09-03 15:22:18 -0400 |
commit | d23a0b0820ff5ea37e9dd71b3589039760e230c9 (patch) | |
tree | 1eebc61e6c1913d183081fdcda86cfb1999917db /pango/pango-glyph-item.c | |
parent | 95ccc8910223d7d092f4cc30c93b4a5f9dcd301a (diff) | |
download | pango-d23a0b0820ff5ea37e9dd71b3589039760e230c9.tar.gz |
PangoGlyphItem: Better treatment of ellipsized runs
When we reapply non-shape attributes, we must take care to
not add any attributes that start in the middle of an
ellipsized run, or we end up with a blue, underlined ellipsis
if there is a link anywhere inside the ellipsized text.
https://bugzilla.gnome.org/show_bug.cgi?id=735732
Diffstat (limited to 'pango/pango-glyph-item.c')
-rw-r--r-- | pango/pango-glyph-item.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/pango/pango-glyph-item.c b/pango/pango-glyph-item.c index 98b06b8b..647a31f3 100644 --- a/pango/pango-glyph-item.c +++ b/pango/pango-glyph-item.c @@ -582,6 +582,7 @@ pango_glyph_item_apply_attrs (PangoGlyphItem *glyph_item, gboolean start_new_segment = FALSE; gboolean have_cluster; int range_start, range_end; + gboolean is_ellipsis; /* This routine works by iterating through the item cluster by * cluster; we accumulate the attributes that we need to @@ -608,11 +609,14 @@ pango_glyph_item_apply_attrs (PangoGlyphItem *glyph_item, state.segment_attrs = pango_attr_iterator_get_attrs (iter); + is_ellipsis = (glyph_item->item->analysis.flags & PANGO_ANALYSIS_FLAG_IS_ELLIPSIS) != 0; + /* Short circuit the case when we don't actually need to * split the item */ - if (range_start <= glyph_item->item->offset && - range_end >= glyph_item->item->offset + glyph_item->item->length) + if (is_ellipsis || + (range_start <= glyph_item->item->offset && + range_end >= glyph_item->item->offset + glyph_item->item->length)) goto out; for (have_cluster = pango_glyph_item_iter_init_start (&state.iter, glyph_item, text); |