From: raster Date: Tue, 14 Oct 2008 02:45:55 +0000 (+0000) Subject: fix some minor bugs in textblock with cursor pos's, text insertion etc. X-Git-Tag: accepted/2.0/20130306.225542~242^2~2781 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1cdffd0f7874e08eaccacd4f79e9b745838f8952;p=profile%2Fivi%2Fevas.git fix some minor bugs in textblock with cursor pos's, text insertion etc. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@36645 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/lib/canvas/evas_object_textblock.c b/src/lib/canvas/evas_object_textblock.c index 7622cd6..e7c2c4c 100644 --- a/src/lib/canvas/evas_object_textblock.c +++ b/src/lib/canvas/evas_object_textblock.c @@ -3212,7 +3212,7 @@ evas_textblock_cursor_text_prepend(Evas_Textblock_Cursor *cur, const char *text) } cur->node = n; index = cur->pos; - if (cur->pos >= (n->len - 1)) + if (cur->pos > (n->len - 1)) n->text = _strbuf_append(n->text, (char *)text, &(n->len), &(n->alloc)); else n->text = _strbuf_insert(n->text, (char *)text, cur->pos, &(n->len), &(n->alloc)); @@ -3868,7 +3868,15 @@ evas_textblock_cursor_char_geometry_get(const Evas_Textblock_Cursor *cur, Evas_C it->text, pos, &x, &y, &w, &h); - if (ret <= 0) return -1; + if (ret <= 0) + { + if (it->format->font.font) + cur->ENFN->font_string_size_get(cur->ENDT, it->format->font.font, + it->text, &w, &h); + x = w; + y = 0; + w = 0; + } x = ln->x + it->x - it->inset + x; if (x < ln->x) { @@ -3885,8 +3893,7 @@ evas_textblock_cursor_char_geometry_get(const Evas_Textblock_Cursor *cur, Evas_C w = fi->w; h = ln->h; } - else - return -1; + else return -1; if (cx) *cx = x; if (cy) *cy = y; if (cw) *cw = w;