From f7cf467b3951374f8eaff726a3bdf9bd78f9e5f6 Mon Sep 17 00:00:00 2001 From: raster Date: Wed, 30 Mar 2011 12:18:21 +0000 Subject: [PATCH] now cursor setting works with newly valigned textbllocks. selection next. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/edje@58207 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/edje_entry.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/lib/edje_entry.c b/src/lib/edje_entry.c index 0926f55..e29538f 100644 --- a/src/lib/edje_entry.c +++ b/src/lib/edje_entry.c @@ -1449,7 +1449,17 @@ _edje_part_mouse_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS line = evas_textblock_cursor_line_coord_set(en->cursor, en->cy); if (line == -1) - _curs_end(en->cursor, rp->object, en); + { + if (rp->part->multiline) + _curs_end(en->cursor, rp->object, en); + else + { + evas_textblock_cursor_paragraph_first(en->cursor); + evas_textblock_cursor_line_geometry_get(en->cursor, &lx, &ly, &lw, &lh); + if (!evas_textblock_cursor_char_coord_set(en->cursor, en->cx, ly + (lh / 2))) + _curs_end(en->cursor, rp->object, en); + } + } else { int lnum; @@ -1581,7 +1591,17 @@ _edje_part_mouse_up_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED line = evas_textblock_cursor_line_coord_set(en->cursor, en->cy); if (line == -1) - _curs_end(en->cursor, rp->object, en); + { + if (rp->part->multiline) + _curs_end(en->cursor, rp->object, en); + else + { + evas_textblock_cursor_paragraph_first(en->cursor); + evas_textblock_cursor_line_geometry_get(en->cursor, &lx, &ly, &lw, &lh); + if (!evas_textblock_cursor_char_coord_set(en->cursor, en->cx, ly + (lh / 2))) + _curs_end(en->cursor, rp->object, en); + } + } else { int lnum; -- 2.7.4