summaryrefslogtreecommitdiff
path: root/src/tests/evas
diff options
context:
space:
mode:
authorAbdullehGhujeh <abdullahhasan10@gmail.com>2020-06-22 16:31:53 +0900
committerWooHyun Jung <wh0705.jung@samsung.com>2020-06-22 16:31:54 +0900
commite3e3d0cfe4d753782d0adc81a68e5cd7ca27c5b9 (patch)
treeca6c31ac83652cfd0d62d8f1eb132f18119a740a /src/tests/evas
parentabc146f37f87200142d44d0feab8986dd219e1fd (diff)
Textblock : Fix cursor cluster movement when emoji at the line start
Summary: if we have emoji only or emoji at line start we can move cursor using mouse click to be inside the emoji. {F3868502} this should fix T8664 Test Plan: #include <Elementary.h> EAPI_MAIN int elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED) { Evas_Object *win; elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); win = elm_win_util_standard_add("emoji-test", "emoji-test"); elm_win_autodel_set(win, EINA_TRUE); /* and now just resize the window to a size you want. normally widgets * will determine the initial size though */ evas_object_resize(win, 320, 320); Evas_Object *box; box = elm_box_add(win); evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_win_resize_object_add(win, box); Evas_Object *entry; entry = elm_entry_add(box); elm_entry_entry_set(entry, "&#x262a;&#xfe0f;"); evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_box_pack_end(box, entry); evas_object_show(entry); evas_object_show(box); /* and show the window */ evas_object_show(win); elm_run(); /* and run the program now, starting to handle all * events, etc. */ /* exit code */ return 0; } ELM_MAIN() Reviewers: ali.alzyod, woohyun, bowonryu, zmike, bu5hm4n Reviewed By: ali.alzyod Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8664 Differential Revision: https://phab.enlightenment.org/D11732
Diffstat (limited to 'src/tests/evas')
-rw-r--r--src/tests/evas/evas_test_textblock.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/tests/evas/evas_test_textblock.c b/src/tests/evas/evas_test_textblock.c
index a0b68ac90a..e56b1d3912 100644
--- a/src/tests/evas/evas_test_textblock.c
+++ b/src/tests/evas/evas_test_textblock.c
@@ -1003,6 +1003,20 @@ EFL_START_TEST(evas_textblock_cursor)
1003 while (evas_textblock_cursor_char_prev(cur2)) j++; 1003 while (evas_textblock_cursor_char_prev(cur2)) j++;
1004 ck_assert_int_eq(j, 4); 1004 ck_assert_int_eq(j, 4);
1005 1005
1006 //make sure if we have cluster at line start we return to pos 0
1007 Evas_Coord x_coord, y_coord;
1008 int pos;
1009
1010 cur2 = evas_object_textblock_cursor_new(tb);
1011 evas_object_textblock_text_markup_set(tb, "&#x262a;&#xfe0f;");
1012
1013 evas_textblock_cursor_char_next(cur2);
1014 evas_textblock_cursor_pen_geometry_get(cur2, &x_coord, &y_coord, NULL, NULL);
1015 evas_textblock_cursor_cluster_coord_set(cur, x_coord, y_coord);
1016 pos = evas_textblock_cursor_pos_get(cur);
1017
1018 ck_assert_int_eq(pos, 0);
1019
1006 END_TB_TEST(); 1020 END_TB_TEST();
1007} 1021}
1008EFL_END_TEST 1022EFL_END_TEST