From: tasn Date: Tue, 12 Apr 2011 07:13:33 +0000 (+0000) Subject: Evas textblock: Fix formatted size calculation with ellipsis. X-Git-Tag: accepted/2.0/20130306.225542~242^2~835 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=23077d3ed791fcca0ceafd60368165e1aff181c1;p=profile%2Fivi%2Fevas.git Evas textblock: Fix formatted size calculation with ellipsis. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@58580 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/lib/canvas/evas_object_textblock.c b/src/lib/canvas/evas_object_textblock.c index ef54db1..b29ec4f 100644 --- a/src/lib/canvas/evas_object_textblock.c +++ b/src/lib/canvas/evas_object_textblock.c @@ -3725,6 +3725,8 @@ _layout(const Evas_Object *obj, int calc_only, int w, int h, int *w_ret, int *h_ /* Start of visual layout creation */ { + Evas_Object_Textblock_Paragraph *last_vis_par = NULL; + EINA_INLIST_FOREACH(c->paragraphs, c->par) { _layout_update_par(c); @@ -3732,18 +3734,31 @@ _layout(const Evas_Object *obj, int calc_only, int w, int h, int *w_ret, int *h_ /* Break if we should stop here. */ if (_layout_visualize_par(c)) { - /* Mark all the rest of the paragraphs as invisible */ + last_vis_par = c->par; + break; + } + } + + /* Mark all the rest of the paragraphs as invisible */ + if (c->par) + { + c->par = (Evas_Object_Textblock_Paragraph *) + EINA_INLIST_GET(c->par)->next; + while (c->par) + { + c->par->visible = 0; c->par = (Evas_Object_Textblock_Paragraph *) EINA_INLIST_GET(c->par)->next; - while (c->par) - { - c->par->visible = 0; - c->par = (Evas_Object_Textblock_Paragraph *) - EINA_INLIST_GET(c->par)->next; - } - break; } } + + /* Get the last visible paragraph in the layout */ + if (!last_vis_par && c->paragraphs) + last_vis_par = (Evas_Object_Textblock_Paragraph *) + EINA_INLIST_GET(c->paragraphs)->last; + + if (last_vis_par) + c->hmax = last_vis_par->y + last_vis_par->h; } /* Clean the rest of the format stack */ @@ -3754,14 +3769,6 @@ _layout(const Evas_Object *obj, int calc_only, int w, int h, int *w_ret, int *h_ _format_unref_free(c->obj, fmt); } - if (c->paragraphs) - { - Evas_Object_Textblock_Paragraph *last_par; - last_par = (Evas_Object_Textblock_Paragraph *) - EINA_INLIST_GET(c->paragraphs)->last; - c->hmax = last_par->y + last_par->h; - } - if (w_ret) *w_ret = c->wmax; if (h_ret) *h_ret = c->hmax;