From f0168128259a3496d6dc5fb431ab2a798f87f8a3 Mon Sep 17 00:00:00 2001 From: tasn Date: Thu, 12 Aug 2010 15:49:43 +0000 Subject: [PATCH] Evas textblock: Fixed cursor sizes in rare situations, for example the text from expedite textblock_basic test and point the 'c' in COLOR you would get a badly shaped cursor. git-svn-id: http://svn.enlightenment.org/svn/e/trunk/evas@51050 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/canvas/evas_object_textblock.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/lib/canvas/evas_object_textblock.c b/src/lib/canvas/evas_object_textblock.c index d3a4e3a..30099a6 100644 --- a/src/lib/canvas/evas_object_textblock.c +++ b/src/lib/canvas/evas_object_textblock.c @@ -3132,10 +3132,9 @@ _find_layout_item_line_match(Evas_Object *obj, Evas_Object_Textblock_Node_Text * itn = (Evas_Object_Textblock_Item *)(((Eina_Inlist *)it)->next); p = (int)(it->source_pos + eina_unicode_strlen(it->text)); - /*FIXME: Bad, this sholud be > pos */ - if ((p >= pos) || + if ((p > pos) || ((p == pos) && (!lnn) && - ((!itn) | + ((!itn) || ((itn) && (itn->source_node != n))))) { *lnr = ln; @@ -4786,8 +4785,7 @@ evas_textblock_cursor_line_char_last(Evas_Textblock_Cursor *cur) cur->node = it->source_node; index = eina_unicode_strlen(it->text) - 1; if (index < 0) index = 0; - if ((index >= 0) && (it->text[0] != 0)) - GET_NEXT(it->text, index); + if (index >= 0) GET_NEXT(it->text, index); if (index >= 0) cur->pos += index; } else if (fi) -- 2.7.4