From: tasn Date: Tue, 15 Feb 2011 16:50:07 +0000 (+0000) Subject: Evas textblock: Fixed a bug that caused format item positions to be wrong in some... X-Git-Tag: submit/trunk/20120815.174732~1891 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=93da70caa5697ef6f954299b14170aa8e72e0911;p=profile%2Fivi%2Fevas.git Evas textblock: Fixed a bug that caused format item positions to be wrong in some cases. Just sanitized some of the item coordinates calculation. git-svn-id: http://svn.enlightenment.org/svn/e/trunk/evas@57055 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/lib/canvas/evas_object_textblock.c b/src/lib/canvas/evas_object_textblock.c index e8e1e52..ae8c5d5 100644 --- a/src/lib/canvas/evas_object_textblock.c +++ b/src/lib/canvas/evas_object_textblock.c @@ -2158,22 +2158,7 @@ _layout_line_order(Ctxt *c __UNUSED__, Evas_Object_Textblock_Line *line) } } } -#endif - - /* Recalculate the positions according to the new order. */ - { - Evas_Object_Textblock_Item *it = line->items; - Evas_Coord x = 0; - - while (it) - { - it->x = x; - x += it->adv; - it = (Evas_Object_Textblock_Item *) EINA_INLIST_GET(it)->next; - } - } -#ifdef BIDI_SUPPORT if (v_to_l) free(v_to_l); #endif } @@ -2192,6 +2177,7 @@ _layout_line_finalize(Ctxt *c, Evas_Object_Textblock_Format *fmt) { Evas_Object_Textblock_Item *it; Eina_Bool no_text = EINA_TRUE; + Evas_Coord x = 0; _layout_line_order(c, c->ln); @@ -2210,7 +2196,6 @@ _layout_line_finalize(Ctxt *c, Evas_Object_Textblock_Format *fmt) EINA_INLIST_FOREACH(c->ln->items, it) { - int endx; if (it->type == EVAS_TEXTBLOCK_ITEM_TEXT) { Evas_Object_Textblock_Text_Item *ti = _ITEM_TEXT(it); @@ -2320,8 +2305,10 @@ _layout_line_finalize(Ctxt *c, Evas_Object_Textblock_Format *fmt) } } - endx = it->x + it->adv; - if (endx > c->ln->w) c->ln->w = endx; + it->x = x; + x += it->adv; + + if (x > c->ln->w) c->ln->w = x; } c->ln->y = (c->y - c->par->y) + c->o->style_pad.t;