Do not mask index in ClutterEntry

This commit is contained in:
Emmanuele Bassi 2007-08-07 14:07:39 +00:00
parent 51ba12c9fd
commit b8d6f3aaab

View File

@ -325,17 +325,17 @@ static void
clutter_entry_ensure_cursor_position (ClutterEntry *entry)
{
ClutterEntryPrivate *priv;
gint index;
gint index_;
PangoRectangle rect;
priv = entry->priv;
if (priv->position == -1)
index = strlen (priv->text);
index_ = strlen (priv->text);
else
index = offset_to_bytes (priv->text, priv->position);
index_ = offset_to_bytes (priv->text, priv->position);
pango_layout_get_cursor_pos (priv->layout, index, &rect, NULL);
pango_layout_get_cursor_pos (priv->layout, index_, &rect, NULL);
priv->cursor_pos.x = rect.x / PANGO_SCALE;
priv->cursor_pos.y = rect.y / PANGO_SCALE;
priv->cursor_pos.width = ENTRY_CURSOR_WIDTH;