From 9fab1edfa33957754791c20c253d4864fc0dcafa Mon Sep 17 00:00:00 2001 From: Youngbok Shin Date: Wed, 9 Nov 2016 18:10:19 +0900 Subject: [PATCH] edje entry: only change cursor position in mouse up Change-Id: Iadf9326ce6470834fbfb2adcf583a3cd12bd5977 --- src/lib/edje/edje_entry.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/lib/edje/edje_entry.c b/src/lib/edje/edje_entry.c index 34be4ec..b590009 100644 --- a/src/lib/edje/edje_entry.c +++ b/src/lib/edje/edje_entry.c @@ -2324,7 +2324,12 @@ _edje_part_mouse_down_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_ evas_object_geometry_get(rp->object, &x, &y, &w, &h); cx = ev->canvas.x - x; cy = ev->canvas.y - y; + + /* TIZEN ONLY(20161109): only change cursor position in mouse up if (!evas_textblock_cursor_char_coord_set(en->cursor, cx, cy)) + */ + if (dosel && !evas_textblock_cursor_cluster_coord_set(en->cursor, cx, cy)) + /* END */ { Evas_Coord lx, ly, lw, lh; int line; @@ -2449,6 +2454,12 @@ _edje_part_mouse_up_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UN Entry *en; Evas_Coord x, y, w, h; Evas_Textblock_Cursor *tc; + + /* TIZEN ONLY(20161109): only change cursor position in mouse up */ + Evas_Coord fh = 0, cly = 0; + Evas_Textblock_Cursor *line_cur; + /* END */ + if ((!ev) || (ev->button != 1)) return; if (!rp) return; if (ev->flags & EVAS_BUTTON_TRIPLE_CLICK) return; @@ -2480,6 +2491,24 @@ _edje_part_mouse_up_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UN evas_object_geometry_get(rp->object, &x, &y, &w, &h); cx = ev->canvas.x - x; cy = ev->canvas.y - y; + + /* TIZEN ONLY(20161109): only change cursor position in mouse up */ + evas_object_textblock_size_formatted_get(rp->object, NULL, &fh); + if (cy > fh) + { + cy = fh - 1; + } + line_cur = evas_object_textblock_cursor_new(rp->object); + evas_textblock_cursor_paragraph_first(line_cur); + evas_textblock_cursor_line_geometry_get(line_cur, NULL, &cly, NULL, NULL); + + if (cy < cly) + { + cy = cly; + } + evas_textblock_cursor_free(line_cur); + /* END */ + // TIZEN_ONLY(20150127): Add evas_textblock_cursor_cluster_* APIs. // //if (!evas_textblock_cursor_char_coord_set(en->cursor, cx, cy)) if (!evas_textblock_cursor_cluster_coord_set(en->cursor, cx, cy)) @@ -3173,6 +3202,10 @@ _edje_entry_select_none(Edje_Real_Part *rp) en = rp->typedata.text->entry_data; if (!en) return; _sel_clear(en->ed, en->cursor, rp->object, en); + + /* TIZEN ONLY(20161109): only change cursor position in mouse up */ + _edje_entry_imf_cursor_info_set(en); + /* ENd */ } void -- 2.7.4