/* Start of visual layout creation */
{
+ Evas_Object_Textblock_Paragraph *last_vis_par = NULL;
+
EINA_INLIST_FOREACH(c->paragraphs, c->par)
{
_layout_update_par(c);
/* 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 */
_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;