From 6b22d99d9376a986046799e4b089b77b04076e5f Mon Sep 17 00:00:00 2001 From: tasn Date: Wed, 13 Jul 2011 15:16:38 +0000 Subject: [PATCH] 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 --- src/lib/canvas/evas_object_textblock.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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; } -- 2.7.4