[pango] Fix pango_glyph_item_iter_prev() around last cluster
- From: Behdad Esfahbod <behdad src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pango] Fix pango_glyph_item_iter_prev() around last cluster
- Date: Sat, 8 Aug 2015 14:16:34 +0000 (UTC)
commit 3463c0d118da131b01179fc432e04a4400fc767b
Author: Behdad Esfahbod <behdad behdad org>
Date: Sat Aug 8 16:12:24 2015 +0200
Fix pango_glyph_item_iter_prev() around last cluster
It was combining the last two clusters. Ouch!
Test added already. Passes now.
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 1d4ff8e..6954ed8 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--;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]