From 328534fc95746ddd38d591efa471db142d1793c4 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 7 Jan 2009 11:44:54 +0000 Subject: [PATCH] [text] Fix cursor sizing The cursor should be slightly smaller than the height of the actor, to allow for painting a border. Let's pad it by 1 pixel on the top and 1 on the bottom. Also, we should use the cursor size everywhere and not use hardcoded magic numbers. --- clutter/clutter-text.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clutter/clutter-text.c b/clutter/clutter-text.c index 922acc758..ee6fcc68d 100644 --- a/clutter/clutter-text.c +++ b/clutter/clutter-text.c @@ -514,7 +514,7 @@ clutter_text_ensure_cursor_position (ClutterText *self) priv->cursor_pos.x = CLUTTER_UNITS_TO_DEVICE (x); priv->cursor_pos.y = CLUTTER_UNITS_TO_DEVICE (y); priv->cursor_pos.width = priv->cursor_size; - priv->cursor_pos.height = CLUTTER_UNITS_TO_DEVICE (cursor_height); + priv->cursor_pos.height = CLUTTER_UNITS_TO_DEVICE (cursor_height) - 2; g_signal_emit (self, text_signals[CURSOR_EVENT], 0, &priv->cursor_pos); } @@ -783,7 +783,7 @@ cursor_paint (ClutterText *self) } if (priv->position == 0) - priv->cursor_pos.x -= 2; + priv->cursor_pos.x -= priv->cursor_size; if (priv->position == priv->selection_bound) {