diff options
author | Behdad Esfahbod <behdad@gnome.org> | 2007-08-08 00:00:37 +0000 |
---|---|---|
committer | Behdad Esfahbod <behdad@src.gnome.org> | 2007-08-08 00:00:37 +0000 |
commit | 647c72eb9e9e6ad8684c3f06fb1ab9a517496f10 (patch) | |
tree | f0175a64dd2cd8c7644ac4eb5a129230df70b325 /pango | |
parent | 3f7461a4f046f2c9a99bb586dae4753faa14ab1f (diff) | |
download | pango-647c72eb9e9e6ad8684c3f06fb1ab9a517496f10.tar.gz |
Bug 464270 – ellipsize doesn't work consistent
2007-08-07 Behdad Esfahbod <behdad@gnome.org>
Bug 464270 – ellipsize doesn't work consistent
* pango/pango-glyph-item.c (_pango_glyph_item_iter_prev_cluster):
Fix. Was jumping two clusters at a time. Oops!
* pango/ellipsize.c (init_state): Minor cleanup.
svn path=/trunk/; revision=2392
Diffstat (limited to 'pango')
-rw-r--r-- | pango/ellipsize.c | 8 | ||||
-rw-r--r-- | pango/pango-glyph-item.c | 2 |
2 files changed, 4 insertions, 6 deletions
diff --git a/pango/ellipsize.c b/pango/ellipsize.c index fb2bce60..aa49720d 100644 --- a/pango/ellipsize.c +++ b/pango/ellipsize.c @@ -114,7 +114,7 @@ init_state (EllipsizeState *state, PangoAttrList *attrs) { GSList *l; - int i, j; + int i; int start_offset; state->layout = line->layout; @@ -130,11 +130,7 @@ init_state (EllipsizeState *state, for (l = line->runs, i = 0; l; l = l->next, i++) { PangoGlyphItem *run = l->data; - int width = 0; - - for (j = 0; j < run->glyphs->num_glyphs; j++) - width += run->glyphs->glyphs[j].geometry.width; - + int width = pango_glyph_string_get_width (run->glyphs); state->run_info[i].run = run; state->run_info[i].width = width; state->run_info[i].start_offset = start_offset; diff --git a/pango/pango-glyph-item.c b/pango/pango-glyph-item.c index 157bb150..07b844bc 100644 --- a/pango/pango-glyph-item.c +++ b/pango/pango-glyph-item.c @@ -280,6 +280,7 @@ _pango_glyph_item_iter_prev_cluster (PangoGlyphItemIter *iter) if (glyphs->log_clusters[glyph_index] != cluster) { + glyph_index++; iter->start_index = item->offset + glyphs->log_clusters[glyph_index]; iter->start_char -= g_utf8_strlen (iter->text + iter->start_index, iter->end_index - iter->start_index); @@ -303,6 +304,7 @@ _pango_glyph_item_iter_prev_cluster (PangoGlyphItemIter *iter) if (glyphs->log_clusters[glyph_index] != cluster) { + glyph_index--; iter->start_index = item->offset + glyphs->log_clusters[glyph_index]; iter->start_char -= g_utf8_strlen (iter->text + iter->start_index, iter->end_index - iter->start_index); |