From 2ecda40ecdfe1ce949d166512d979d7608ea57aa Mon Sep 17 00:00:00 2001 From: Tom Hacohen 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. SVN revision: 51050 --- legacy/evas/src/lib/canvas/evas_object_textblock.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/legacy/evas/src/lib/canvas/evas_object_textblock.c b/legacy/evas/src/lib/canvas/evas_object_textblock.c index d3a4e3a8ad..30099a6636 100644 --- a/legacy/evas/src/lib/canvas/evas_object_textblock.c +++ b/legacy/evas/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)