From: Tom Hacohen Date: Mon, 20 Aug 2012 11:05:48 +0000 (+0000) Subject: Evas textblock: Reverted my last commit and added WooHyun's instead. X-Git-Tag: submit/devel/efl/20131022.203902~4568 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=05136cc824d52db9ecf519309d603ac5a522ba96;p=platform%2Fupstream%2Fefl.git Evas textblock: Reverted my last commit and added WooHyun's instead. They were pretty similar, but I think WooHyun's was better. Thanks to WooHyun for the patch. SVN revision: 75461 --- diff --git a/legacy/evas/src/lib/canvas/evas_object_textblock.c b/legacy/evas/src/lib/canvas/evas_object_textblock.c index 0943bb5..e9c2a9f 100644 --- a/legacy/evas/src/lib/canvas/evas_object_textblock.c +++ b/legacy/evas/src/lib/canvas/evas_object_textblock.c @@ -8841,14 +8841,22 @@ _evas_textblock_cursor_range_in_line_geometry_get( tr->w = w; } } - else if ((it1 == it2) && (it1->type == EVAS_TEXTBLOCK_ITEM_FORMAT)) - { - tr = calloc(1, sizeof(Evas_Textblock_Rectangle)); - rects = eina_list_append(rects, tr); - tr->x = ln->x + it1->x; - tr->y = ln->par->y + ln->y; - tr->h = ln->h; - tr->w = it1->w; + else if ((it1 == it2) && (it1->type != EVAS_TEXTBLOCK_ITEM_TEXT)) + { + Evas_Coord x, w; + x = 0; + w = it1->w; + _evas_textblock_range_calc_x_w(it1, &x, &w, EINA_TRUE, + switch_items); + if (w > 0) + { + tr = calloc(1, sizeof(Evas_Textblock_Rectangle)); + rects = eina_list_append(rects, tr); + tr->x = ln->x + it1->x + x; + tr->y = ln->par->y + ln->y; + tr->h = ln->h; + tr->w = w; + } } else if (it1 != it2) {