forked from enlightenment/efl
Evas textblock: Fix a bug with ellipsis and word-wrap.
Ellipsis didn't work well with word wrapping textblocks. SVN revision: 67333
This commit is contained in:
parent
408b4b5a39
commit
7266659814
|
@ -3798,9 +3798,23 @@ _layout_par(Ctxt *c)
|
|||
* char is a whitespace we should remove, so this
|
||||
* is a wanted cutting point. */
|
||||
else if (uwrap > it->text_pos + it_len)
|
||||
wrap = -1; /* Delay the cut in a smart way
|
||||
i.e use the item_pos as the line_start, because
|
||||
there's already no cut before*/
|
||||
{
|
||||
/* FIXME: Should redo the ellipsis handling.
|
||||
* If we can do ellipsis, just cut here. */
|
||||
if (it->format->ellipsis == 1.0)
|
||||
{
|
||||
_layout_handle_ellipsis(c, it, i);
|
||||
ret = 1;
|
||||
goto end;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Delay the cut in a smart way i.e use the
|
||||
item_pos as the line_start, because
|
||||
there's already no cut before*/
|
||||
wrap = -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
wrap -= it->text_pos; /* Cut here */
|
||||
}
|
||||
|
|
|
@ -1238,6 +1238,13 @@ START_TEST(evas_textblock_wrapping)
|
|||
evas_object_textblock_size_formatted_get(tb, &w, &h);
|
||||
fail_if((w > (nw / 2)) || (h != nh));
|
||||
|
||||
evas_object_textblock_text_markup_set(tb, "aaaaaaaaaaaaaaaaaa<br/>b");
|
||||
evas_textblock_cursor_format_prepend(cur, "+ ellipsis=1.0 wrap=word");
|
||||
evas_object_textblock_size_native_get(tb, &nw, &nh);
|
||||
evas_object_resize(tb, nw / 2, nh * 2);
|
||||
evas_object_textblock_size_formatted_get(tb, &w, &h);
|
||||
fail_if(w > (nw / 2));
|
||||
|
||||
END_TB_TEST();
|
||||
}
|
||||
END_TEST
|
||||
|
|
Loading…
Reference in New Issue