Bug 1085 - Cursor is in wrong position on ClutterEntry if set
authorNeil Roberts <neil@openedhand.com>
Mon, 18 Aug 2008 15:33:38 +0000 (15:33 +0000)
committerNeil Roberts <neil@openedhand.com>
Mon, 18 Aug 2008 15:33:38 +0000 (15:33 +0000)
x-align property

* clutter/clutter-entry.c (clutter_entry_paint): When calculating
the position to draw the cursor at, take into account the
alignment of the text. Queue a redraw when the x-align property is
changed.

ChangeLog
clutter/clutter-entry.c

index 57b4a70..c02a24d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2008-08-18  Neil Roberts  <neil@o-hand.com>
+
+       Bug 1085 - Cursor is in wrong position on ClutterEntry if set
+       x-align property
+
+       * clutter/clutter-entry.c (clutter_entry_paint): When calculating
+       the position to draw the cursor at, take into account the
+       alignment of the text. Queue a redraw when the x-align property is
+       changed.
+
 2008-08-07  Neil Roberts  <neil@o-hand.com>
 
        Bug 1091 - WM_MOUSEWHEEL (scroll-event) not handled correctlly
index 9d0a7ef..bea4881 100644 (file)
@@ -191,6 +191,7 @@ clutter_entry_set_property (GObject      *object,
       break;
     case PROP_X_ALIGN:
       entry->priv->x_align = g_value_get_double (value);
+      clutter_actor_queue_redraw (CLUTTER_ACTOR (object));
       break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -492,7 +493,7 @@ clutter_entry_paint (ClutterActor *self)
   else
     {
       priv->text_x = (actor_width - text_width) * priv->x_align;
-      priv->cursor_pos.x += priv->entry_padding;
+      priv->cursor_pos.x += priv->text_x + priv->entry_padding;
     }
 
   memcpy (&color, &priv->fgcol, sizeof (ClutterColor));