[text] account for scrolling in clutter_text_position_to_coords

Add any scrolling offset to the x value when in single line mode.

Now that the offset is taken into account in the position_to_coords
function, we do not need to adjust the cursor x manually in
clutter_text_paint.
This commit is contained in:
Thomas Wood 2009-05-14 10:53:44 +01:00
parent 16185c78fc
commit e79fd1055d

View File

@ -535,6 +535,15 @@ clutter_text_position_to_coords (ClutterText *self,
if (line_height)
*line_height = CLUTTER_UNITS_FROM_PANGO_UNIT (rect.height);
if (self->priv->single_line_mode)
{
/* Take any offset due to scrolling into account */
if (x)
*x += self->priv->text_x;
}
/* FIXME: should return false if coords were outside text */
return TRUE;
}
@ -1380,7 +1389,6 @@ clutter_text_paint (ClutterActor *self)
{
text_x = TEXT_PADDING;
}
priv->cursor_pos.x += text_x;
}
else
text_x = 0;