diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2015-08-08 16:12:24 +0200 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2015-08-08 16:14:36 +0200 |
commit | 3463c0d118da131b01179fc432e04a4400fc767b (patch) | |
tree | 55d36314d2c246e03902fe16e0f11050f72e93d8 /pango | |
parent | acbd5a6d4d92715263b3e99113caa7ac7a002776 (diff) | |
download | pango-3463c0d118da131b01179fc432e04a4400fc767b.tar.gz |
Fix pango_glyph_item_iter_prev() around last cluster
It was combining the last two clusters. Ouch!
Test added already. Passes now.
Diffstat (limited to 'pango')
-rw-r--r-- | pango/pango-glyph-item.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pango/pango-glyph-item.c b/pango/pango-glyph-item.c index 1d4ff8ea..6954ed86 100644 --- a/pango/pango-glyph-item.c +++ b/pango/pango-glyph-item.c @@ -359,8 +359,6 @@ pango_glyph_item_iter_prev_cluster (PangoGlyphItemIter *iter) cluster = glyphs->log_clusters[glyph_index - 1]; while (TRUE) { - glyph_index--; - if (glyph_index == 0) { iter->start_index = item->offset; @@ -368,6 +366,8 @@ pango_glyph_item_iter_prev_cluster (PangoGlyphItemIter *iter) break; } + glyph_index--; + if (glyphs->log_clusters[glyph_index] != cluster) { glyph_index++; @@ -383,8 +383,6 @@ pango_glyph_item_iter_prev_cluster (PangoGlyphItemIter *iter) cluster = glyphs->log_clusters[glyph_index + 1]; while (TRUE) { - glyph_index++; - if (glyph_index == glyphs->num_glyphs - 1) { iter->start_index = item->offset; @@ -392,6 +390,8 @@ pango_glyph_item_iter_prev_cluster (PangoGlyphItemIter *iter) break; } + glyph_index++; + if (glyphs->log_clusters[glyph_index] != cluster) { glyph_index--; |