From 1128519838adc810f1a98982e0fc90b81ed0160a Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Thu, 14 Jul 2011 08:00:23 +0000 Subject: [PATCH] Evas textblock: Fixed issue with char/line_coord_set with valign. #2. After adding some tests, I found out that my previous fix was not enough. SVN revision: 61362 --- legacy/evas/src/lib/canvas/evas_object_textblock.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/legacy/evas/src/lib/canvas/evas_object_textblock.c b/legacy/evas/src/lib/canvas/evas_object_textblock.c index d7d3dc3ee9..6d01ad1412 100644 --- a/legacy/evas/src/lib/canvas/evas_object_textblock.c +++ b/legacy/evas/src/lib/canvas/evas_object_textblock.c @@ -7685,14 +7685,14 @@ evas_textblock_cursor_char_coord_set(Evas_Textblock_Cursor *cur, Evas_Coord x, E } } } - else if (y > o->formatted.h) + else if (o->paragraphs && (y > o->paragraphs->y + o->formatted.h)) { /* If we are after the last paragraph, use the last position in the * text. */ evas_textblock_cursor_paragraph_last(cur); return EINA_TRUE; } - else if ((y < 0) || (o->paragraphs && (y < o->paragraphs->y))) + else if (o->paragraphs && (y < o->paragraphs->y)) { evas_textblock_cursor_paragraph_first(cur); return EINA_TRUE; @@ -7729,7 +7729,7 @@ evas_textblock_cursor_line_coord_set(Evas_Textblock_Cursor *cur, Evas_Coord y) } } } - else if (y > o->formatted.h) + else if (o->paragraphs && (y > o->paragraphs->y + o->formatted.h)) { int line_no = 0; /* If we are after the last paragraph, use the last position in the @@ -7746,7 +7746,7 @@ evas_textblock_cursor_line_coord_set(Evas_Textblock_Cursor *cur, Evas_Coord y) } return line_no; } - else if ((y < 0) || (o->paragraphs && (y < o->paragraphs->y))) + else if (o->paragraphs && (y < o->paragraphs->y)) { int line_no = 0; evas_textblock_cursor_paragraph_first(cur);