diff options
author | Daniel Hirt <daniel.hirt@samsung.com> | 2016-03-22 22:48:10 +0200 |
---|---|---|
committer | Daniel Hirt <daniel.hirt@samsung.com> | 2016-03-22 22:48:10 +0200 |
commit | a18d1d86844578c86686e4adab314a85105eb508 (patch) | |
tree | 8c31543c1ebaec2f1d649701af0a82f02f958420 | |
parent | bbed39a6217ba6c58e0b9225b0129bfb1ede223a (diff) | |
download | efl-devs/herdsman/tb_next.tar.gz |
add a bunch of fixes and tests - to be splitdevs/herdsman/tb_next
-rw-r--r-- | src/lib/evas/canvas/evas_object_textblock.c | 3 | ||||
-rw-r--r-- | src/lib/evas/common/evas_font_query.c | 2 | ||||
-rw-r--r-- | src/tests/evas/evas_test_textblock.c | 16 |
3 files changed, 18 insertions, 3 deletions
diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index fbffa1c393..baeb0f2c11 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -3761,7 +3761,8 @@ _layout_item_text_split_strip_white(Ctxt *c, /* Strip the previous white if needed */ if ((cut >= 1) && _is_white(ts[cut - 1]) && (ti->text_props.text_len > 0)) { - if (cut - 1 > 0) + if ((cut - 1 > 0) || + ((cut - 1 >= 0) && c->ln->items && (c->ln->items->text_pos < ti->parent.text_pos))) { size_t white_cut = cut - 1; white_ti = _layout_text_item_new(c, ti->parent.format); diff --git a/src/lib/evas/common/evas_font_query.c b/src/lib/evas/common/evas_font_query.c index 4ee79fe0e4..af4535f6eb 100644 --- a/src/lib/evas/common/evas_font_query.c +++ b/src/lib/evas/common/evas_font_query.c @@ -850,7 +850,7 @@ evas_common_font_query_last_up_to_pos(RGBA_Font *fn, const Evas_Text_Props *text if ((x >= EVAS_FONT_WALK_PEN_X) && ((x < (EVAS_FONT_WALK_PEN_X_AFTER)) || - (x <= (EVAS_FONT_WALK_PEN_X + _glyph_itr->width))) && + (x < (EVAS_FONT_WALK_PEN_X + _glyph_itr->x_bear + _glyph_itr->width))) && (y >= -asc) && (y <= desc)) { ret = EVAS_FONT_WALK_POS; diff --git a/src/tests/evas/evas_test_textblock.c b/src/tests/evas/evas_test_textblock.c index 37509ad520..c5a977efe9 100644 --- a/src/tests/evas/evas_test_textblock.c +++ b/src/tests/evas/evas_test_textblock.c @@ -2210,7 +2210,21 @@ START_TEST(evas_textblock_wrapping) evas_object_textblock_size_formatted_get(tb, NULL, &h); ck_assert_int_ge(h, bh); -#ifdef HAVE_FRIBIDI + /* Check char-wrapping for small items */ + evas_object_textblock_text_markup_set(tb, "x"); + evas_object_textblock_size_native_get(tb, &bw, NULL); + evas_object_textblock_text_markup_set(tb, "AxAx"); + evas_textblock_cursor_format_prepend(cur, "+ wrap=char"); + evas_object_textblock_size_native_get(tb, &nw, &nh); + evas_object_resize(tb, nw - bw, nh); + evas_object_textblock_size_formatted_get(tb, &bw, NULL); + + evas_object_textblock_text_markup_set(tb, "A<color=#f00>x</color>Ax"); + evas_textblock_cursor_format_prepend(cur, "+ wrap=char"); + evas_object_textblock_size_formatted_get(tb, &w, NULL); + ck_assert_int_eq(bw, w); + +#if 1 /* Check the ellipsis is placed at proper place * in RTL text with formats */ evas_object_textblock_text_markup_set(tb, ")"); |