From: tasn Date: Wed, 13 Jul 2011 15:16:38 +0000 (+0000) Subject: Evas textblock: Fixed a bug in line_coord_set with y<0. X-Git-Tag: submit/trunk/20120815.174732~1150 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6b22d99d9376a986046799e4b089b77b04076e5f;p=profile%2Fivi%2Fevas.git Evas textblock: Fixed a bug in line_coord_set with y<0. git-svn-id: http://svn.enlightenment.org/svn/e/trunk/evas@61344 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/lib/canvas/evas_object_textblock.c b/src/lib/canvas/evas_object_textblock.c index 790b354..afa01ee 100644 --- a/src/lib/canvas/evas_object_textblock.c +++ b/src/lib/canvas/evas_object_textblock.c @@ -7735,7 +7735,6 @@ evas_textblock_cursor_line_coord_set(Evas_Textblock_Cursor *cur, Evas_Coord y) /* If we are after the last paragraph, use the last position in the * text. */ evas_textblock_cursor_paragraph_last(cur); - evas_textblock_cursor_char_next(cur); if (cur->node && cur->node->par) { line_no = cur->node->par->line_no; @@ -7747,6 +7746,16 @@ evas_textblock_cursor_line_coord_set(Evas_Textblock_Cursor *cur, Evas_Coord y) } return line_no; } + else if (y < 0) + { + int line_no = 0; + evas_textblock_cursor_paragraph_first(cur); + if (cur->node && cur->node->par) + { + line_no = cur->node->par->line_no; + } + return line_no; + } return -1; }