diff options
author | Behdad Esfahbod <behdad@gnome.org> | 2007-08-15 19:41:00 +0000 |
---|---|---|
committer | Behdad Esfahbod <behdad@src.gnome.org> | 2007-08-15 19:41:00 +0000 |
commit | 12af073c1075f06996353f53e6343e509573d0f2 (patch) | |
tree | 238f815d1a63f2d8788f7cbd9516b52319804fda | |
parent | f90163fecc2f1e10ea1c800c2ac3045b485398bd (diff) | |
download | pango-12af073c1075f06996353f53e6343e509573d0f2.tar.gz |
Bug 462420 – Clicking on pixbuf should move the cursor to the position
2007-08-15 Behdad Esfahbod <behdad@gnome.org>
Bug 462420 – Clicking on pixbuf should move the cursor to the position
nearest to the click point
* pango/pango-layout.c (pango_layout_line_x_to_index): Remove
special-casing for shape-attribute runs. It all works because
pango_glyph_string_x_to_index() is perfectly correct to run on glyphs
returned by _pango_shape_shape().
svn path=/trunk/; revision=2402
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | pango/pango-layout.c | 21 |
2 files changed, 16 insertions, 15 deletions
@@ -1,5 +1,15 @@ 2007-08-15 Behdad Esfahbod <behdad@gnome.org> + Bug 462420 – Clicking on pixbuf should move the cursor to the position + nearest to the click point + + * pango/pango-layout.c (pango_layout_line_x_to_index): Remove + special-casing for shape-attribute runs. It all works because + pango_glyph_string_x_to_index() is perfectly correct to run on glyphs + returned by _pango_shape_shape(). + +2007-08-15 Behdad Esfahbod <behdad@gnome.org> + Bug 467056 – Shape attribute handling is not consistent * pango/pango-impl-utils.h: diff --git a/pango/pango-layout.c b/pango/pango-layout.c index 75af389a..dd5c850e 100644 --- a/pango/pango-layout.c +++ b/pango/pango-layout.c @@ -3891,22 +3891,13 @@ pango_layout_line_x_to_index (PangoLayoutLine *line, int pos; int char_index; - char_index = run->item->offset; + pango_glyph_string_x_to_index (run->glyphs, + layout->text + run->item->offset, run->item->length, + &run->item->analysis, + x_pos - start_pos, + &pos, &char_trailing); - if (properties.shape_set) - { - char_trailing = FALSE; - } - else - { - pango_glyph_string_x_to_index (run->glyphs, - layout->text + run->item->offset, run->item->length, - &run->item->analysis, - x_pos - start_pos, - &pos, &char_trailing); - - char_index += pos; - } + char_index = run->item->offset + pos; /* Convert from characters to graphemes */ |