From 12af073c1075f06996353f53e6343e509573d0f2 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 15 Aug 2007 19:41:00 +0000 Subject: =?UTF-8?q?Bug=20462420=20=E2=80=93=20Clicking=20on=20pixbuf=20sho?= =?UTF-8?q?uld=20move=20the=20cursor=20to=20the=20position?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2007-08-15 Behdad Esfahbod 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 --- ChangeLog | 10 ++++++++++ pango/pango-layout.c | 21 ++++++--------------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index d1447d54..a0a2269b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2007-08-15 Behdad Esfahbod + + 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 Bug 467056 – Shape attribute handling is not consistent 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 */ -- cgit v1.2.1