summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAli Alzyod <ali198724@gmail.com>2019-12-26 09:55:28 +0900
committerWooHyun Jung <wh0705.jung@samsung.com>2019-12-26 09:55:28 +0900
commit84685df233b2e499227a6c4e990c6216117a9a21 (patch)
tree7afadce1e9f09234c00d4fec3fc4a39c8e002a74
parentc008309f78c285d39f3a25986a5238a89f91cff6 (diff)
efl_text_cursor: line jump by fix movement
Summary: When the cursor is at line beginning of line, and user click "Up" then "Down" on keyboard cursor will position at second character. If text is: **occaecat \n mollit** Reviewers: woohyun, zmike, cedric, segfaultxavi Reviewed By: woohyun Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8454 Differential Revision: https://phab.enlightenment.org/D10947
-rw-r--r--src/lib/evas/canvas/evas_object_textblock.c2
-rw-r--r--src/tests/evas/evas_test_textblock.c7
2 files changed, 8 insertions, 1 deletions
diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c
index c47175fcc2..5516e712bd 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -11033,7 +11033,7 @@ evas_textblock_cursor_line_jump_by(Efl_Text_Cursor_Handle *cur, int by)
11033 pnode = cur->node; 11033 pnode = cur->node;
11034 ppos = cur->pos; 11034 ppos = cur->pos;
11035 11035
11036 evas_textblock_cursor_geometry_get(cur, &cx, NULL, &cw, NULL, NULL, EVAS_TEXTBLOCK_CURSOR_UNDER); 11036 evas_textblock_cursor_geometry_get(cur, &cx, NULL, &cw, NULL, NULL, EVAS_TEXTBLOCK_CURSOR_BEFORE);
11037 cx += (cw / 2); 11037 cx += (cw / 2);
11038 evas_textblock_cursor_paragraph_last(cur); 11038 evas_textblock_cursor_paragraph_last(cur);
11039 last = evas_textblock_cursor_line_geometry_get(cur, NULL, NULL, NULL, NULL); 11039 last = evas_textblock_cursor_line_geometry_get(cur, NULL, NULL, NULL, NULL);
diff --git a/src/tests/evas/evas_test_textblock.c b/src/tests/evas/evas_test_textblock.c
index f4806cb459..3a112a0048 100644
--- a/src/tests/evas/evas_test_textblock.c
+++ b/src/tests/evas/evas_test_textblock.c
@@ -4522,6 +4522,13 @@ EFL_START_TEST(efl_canvas_textblock_cursor)
4522 efl_text_cursor_text_object_get(cursor1), 4522 efl_text_cursor_text_object_get(cursor1),
4523 efl_text_cursor_text_object_get(cursor_temp)); 4523 efl_text_cursor_text_object_get(cursor_temp));
4524 4524
4525 efl_text_set(txt, "occaecat \n mollit");
4526 efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_FIRST);
4527 efl_text_cursor_line_jump_by(cur_obj, 1);
4528 efl_text_cursor_line_jump_by(cur_obj, -1);
4529 ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 0);
4530
4531
4525 END_EFL_CANVAS_TEXTBLOCK_TEST(); 4532 END_EFL_CANVAS_TEXTBLOCK_TEST();
4526} 4533}
4527EFL_END_TEST 4534EFL_END_TEST