From 5389aa2daacc6d41e1a2adeed24ca49f30d371ec Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 25 Dec 2009 16:03:12 +0100 Subject: Simplify cluster analysis --- pango/pango-layout.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pango/pango-layout.c b/pango/pango-layout.c index f78fbb49..c60c7e8f 100644 --- a/pango/pango-layout.c +++ b/pango/pango-layout.c @@ -4853,7 +4853,6 @@ zero_line_final_space (PangoLayoutLine *line, PangoItem *item = run->item; PangoGlyphString *glyphs = run->glyphs; int glyph = item->analysis.level % 2 ? 0 : glyphs->num_glyphs - 1; - const char *p; /* if the final char of line forms a cluster, and it's * a whitespace char, zero its glyph's width as it's been wrapped @@ -4863,8 +4862,8 @@ zero_line_final_space (PangoLayoutLine *line, !layout->log_attrs[state->start_offset - 1].is_white) return; - p = g_utf8_prev_char (layout->text + item->offset + item->length); - if (p != layout->text + item->offset + glyphs->log_clusters[glyph]) + if (glyphs->num_glyphs >= 2 && + glyphs->log_clusters[glyph] == glyphs->log_clusters[glyph + (item->analysis.level % 2 ? 1 : -1)]) return; state->remaining_width += glyphs->glyphs[glyph].geometry.width; -- cgit v1.2.1