From 6b782ce4e720f07bd678ce613b81987fde13ff38 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Tue, 16 Dec 2008 15:53:57 +0000 Subject: [PATCH] Fix the selection behaviour around the 0th glyph After fixing the cursor position issues around the initial glyph of the layout, the selection position needs fixing as well. The fix is similar: check if the position of the selection is 0 and provide a fast path by setting the offset to 0. --- clutter/clutter-text.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/clutter/clutter-text.c b/clutter/clutter-text.c index 4d70c2fc5..e9eb6e174 100644 --- a/clutter/clutter-text.c +++ b/clutter/clutter-text.c @@ -811,8 +811,15 @@ cursor_paint (ClutterText *self) gint end_index; gint line_no; - start_index = offset_to_bytes (utf8, priv->position); - end_index = offset_to_bytes (utf8, priv->selection_bound); + if (priv->position == 0) + start_index = 0; + else + start_index = offset_to_bytes (utf8, priv->position); + + if (priv->selection_bound == 0) + end_index = 0; + else + end_index = offset_to_bytes (utf8, priv->selection_bound); if (start_index > end_index) {