forked from enlightenment/efl
Evas textblock: fix height on line wrapping
Line advance should finalize the line with its last item, and not the item we're currently wrapping. This fixes T1583, where some line wrapping cases would look different than their equivalent <ps> versions. @fix
This commit is contained in:
parent
7236343701
commit
59e9e2ddc8
|
@ -3642,6 +3642,8 @@ loop_advance:
|
|||
static void
|
||||
_layout_line_advance(Ctxt *c, Evas_Object_Textblock_Format *fmt)
|
||||
{
|
||||
Evas_Object_Textblock_Format *last_fmt = fmt;
|
||||
|
||||
if (c->hyphen_ti)
|
||||
{
|
||||
c->ln->items = (Evas_Object_Textblock_Item *)
|
||||
|
@ -3652,7 +3654,11 @@ _layout_line_advance(Ctxt *c, Evas_Object_Textblock_Format *fmt)
|
|||
eina_list_append(c->o->hyphen_items, c->hyphen_ti);
|
||||
c->hyphen_ti = NULL;
|
||||
}
|
||||
_layout_line_finalize(c, fmt);
|
||||
if (c->ln->items)
|
||||
{
|
||||
last_fmt = _ITEM(EINA_INLIST_GET(c->ln->items)->last)->format;
|
||||
}
|
||||
_layout_line_finalize(c, last_fmt);
|
||||
_layout_line_new(c, fmt);
|
||||
}
|
||||
|
||||
|
|
|
@ -2162,6 +2162,15 @@ START_TEST(evas_textblock_wrapping)
|
|||
ck_assert_int_eq(bret, ret);
|
||||
}
|
||||
|
||||
/* Check that line wrap produces the same height values as paragraph break */
|
||||
evas_object_resize(tb, 1, 100);
|
||||
evas_object_textblock_text_markup_set(tb, "<wrap=word>hello world");
|
||||
evas_object_textblock_size_formatted_get(tb, NULL, &bh);
|
||||
evas_object_textblock_text_markup_set(tb, "hello<ps>world");
|
||||
evas_object_textblock_size_formatted_get(tb, NULL, &h);
|
||||
|
||||
ck_assert_int_eq(bh, h);
|
||||
|
||||
END_TB_TEST();
|
||||
}
|
||||
END_TEST
|
||||
|
|
Loading…
Reference in New Issue