[text] position the cursor correctly in single line mode

The position of the text should be increased by the value of TEXT_PADDING
and the cursor offset by the same value as the text offset.
This commit is contained in:
Thomas Wood 2009-05-14 10:17:24 +01:00
parent cd86e70f41
commit e162d0b060

View File

@ -1354,11 +1354,10 @@ clutter_text_paint (ClutterActor *self)
if (priv->position == -1) if (priv->position == -1)
{ {
text_x = actor_width - text_width; text_x = actor_width - text_width;
priv->cursor_pos.x += text_x + TEXT_PADDING;
} }
else if (priv->position == 0) else if (priv->position == 0)
{ {
text_x = 0; text_x = TEXT_PADDING;
} }
else else
{ {
@ -1375,9 +1374,9 @@ clutter_text_paint (ClutterActor *self)
} }
else else
{ {
text_x = 0; text_x = TEXT_PADDING;
priv->cursor_pos.x += text_x + TEXT_PADDING;
} }
priv->cursor_pos.x += text_x;
} }
else else
text_x = 0; text_x = 0;