[text] fix problems with scrolling interaction

The cursor x position is already translated, so we do not need to take the
actors allocation into account when calculating scrolling.

Additionally, we need to update the text_x value before running
clutter_text_ensure_cursor_position.
This commit is contained in:
Thomas Wood 2009-05-14 15:08:31 +01:00
parent a3a5fe5594
commit 81a536238d

View File

@ -1368,7 +1368,7 @@ clutter_text_paint (ClutterActor *self)
if (actor_width < text_width)
{
gint cursor_x = priv->cursor_pos.x - alloc.x1;
gint cursor_x = priv->cursor_pos.x;
if (priv->position == -1)
{
@ -1391,6 +1391,7 @@ clutter_text_paint (ClutterActor *self)
}
/* Update the absolute cursor position as it may have moved due to
* scrolling */
priv->text_x = text_x;
clutter_text_ensure_cursor_position (text);
}