mirror of
https://github.com/brl/mutter.git
synced 2024-11-26 18:11:05 -05:00
[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.
This commit is contained in:
parent
f3142a70dc
commit
328534fc95
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user