From 6b4a033efedb80e01330addc9e41f7213f7845ad Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Mon, 18 Aug 2008 15:33:38 +0000 Subject: [PATCH] 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. --- ChangeLog | 10 ++++++++++ clutter/clutter-entry.c | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 57b4a70a8..c02a24d80 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2008-08-18 Neil Roberts + + 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 Bug 1091 - WM_MOUSEWHEEL (scroll-event) not handled correctlly diff --git a/clutter/clutter-entry.c b/clutter/clutter-entry.c index 9d0a7ef61..bea4881d8 100644 --- a/clutter/clutter-entry.c +++ b/clutter/clutter-entry.c @@ -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));