summaryrefslogtreecommitdiff
path: root/pango
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2002-01-11 20:33:40 +0000
committerHavoc Pennington <hp@src.gnome.org>2002-01-11 20:33:40 +0000
commiteee75e94a4d0cc97354a6d5fcc7898b0ac0fa2ce (patch)
tree3931d834e7889ce8c4e40e909a5646efbe0e7410 /pango
parent2ac3d4c416d0d761b3012c6c4eebe3d00ad157a0 (diff)
downloadpango-eee75e94a4d0cc97354a6d5fcc7898b0ac0fa2ce.tar.gz
docs tweak (pango_layout_iter_next_cluster): update iter->index here
2002-01-11 Havoc Pennington <hp@redhat.com> * pango/pango-layout.c (pango_layout_iter_get_index): docs tweak (pango_layout_iter_next_cluster): update iter->index here
Diffstat (limited to 'pango')
-rw-r--r--pango/pango-layout.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/pango/pango-layout.c b/pango/pango-layout.c
index 76a1a085..068bd7fb 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -4029,7 +4029,8 @@ pango_layout_iter_free (PangoLayoutIter *iter)
*
* Gets the current byte index. Note that iterating forward by char
* moves in visual order, not logical order, so indexes may not be
- * sequential.
+ * sequential. Also, the index may be equal to the length of the text
+ * in the layout, if on the %NULL run (see pango_layout_iter_get_run()).
*
* Return value: current byte index
**/
@@ -4189,6 +4190,7 @@ pango_layout_iter_next_cluster (PangoLayoutIter *iter)
iter->cluster_start = iter->next_cluster_start;
iter->next_cluster_start = next_cluster_start (gs, iter->cluster_start);
iter->cluster_index = gs->log_clusters[iter->cluster_start];
+ iter->index = iter->cluster_index;
return TRUE;
}
}
@@ -4274,6 +4276,7 @@ pango_layout_iter_next_line (PangoLayoutIter *iter)
else
iter->run = NULL;
+ /* FIXME isn't this broken? we can have \r\n etc. */
/* If we move on to an empty line (no runs), it means the empty line
* represents a '\n' in layout->text, so advance iter->index
*/
@@ -4340,6 +4343,8 @@ pango_layout_iter_get_char_extents (PangoLayoutIter *iter,
end_index = start_index;
start_index = tmp;
}
+
+ g_assert (start_index < end_index);
p = iter->layout->text + start_index;
current = iter->layout->text + iter->index;