[pango] PangoGlyphItem: Better treatment of ellipsized runs
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pango] PangoGlyphItem: Better treatment of ellipsized runs
- Date: Wed, 3 Sep 2014 19:23:38 +0000 (UTC)
commit d23a0b0820ff5ea37e9dd71b3589039760e230c9
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Sep 2 18:18:21 2014 -0400
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
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 98b06b8..647a31f 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]