[text] take scrolling into account when calculating cursor position

Account for the scrolling in single line more when calculating the cursor
position from coordinates.
This commit is contained in:
Thomas Wood 2009-05-14 10:51:58 +01:00
parent e162d0b060
commit 16185c78fc

View File

@ -463,6 +463,10 @@ clutter_text_coords_to_position (ClutterText *text,
gint px, py; gint px, py;
gint trailing; gint trailing;
/* Take any offset due to scrolling into account */
if (text->priv->single_line_mode)
x += text->priv->text_x * -1;
px = x * PANGO_SCALE; px = x * PANGO_SCALE;
py = y * PANGO_SCALE; py = y * PANGO_SCALE;