tasn pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=b360084d0dcb3173e362f3ce4862d53e8098bedf

commit b360084d0dcb3173e362f3ce4862d53e8098bedf
Author: Tom Hacohen <t...@stosb.com>
Date:   Fri Jun 26 15:11:17 2015 +0100

    Evas textblock: Fix issue with line_coord_set and y before the first line.
    
    Let's assume we have a textblock with one paragraph at y = 3 and h = 50
    At the moment, passing 60 (after the paragraph) to line_coord_set picks
    the last line, however passing 0, just fails. This fixes that.
    
    Thanks to Vladyslav Shevchenko for reporting it in D2574.
    
    @fix
---
 src/lib/evas/canvas/evas_object_textblock.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/lib/evas/canvas/evas_object_textblock.c 
b/src/lib/evas/canvas/evas_object_textblock.c
index c8cf754..2352281 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -10200,6 +10200,13 @@ 
evas_textblock_cursor_line_coord_set(Evas_Textblock_Cursor *cur, Evas_Coord y)
 
    if (found_par)
      {
+        /* If we are before the first paragraph, use the first position in the 
text */
+        if ((found_par->y >= y) && (!EINA_INLIST_GET(found_par)->prev))
+          {
+             evas_textblock_cursor_paragraph_first(cur);
+             return 0;
+          }
+
         _layout_paragraph_render(o, found_par);
         EINA_INLIST_FOREACH(found_par->lines, ln)
           {

-- 


Reply via email to