Evas textblock: Fixed a bug in line_coord_set with y<0.
authortasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 13 Jul 2011 15:16:38 +0000 (15:16 +0000)
committertasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 13 Jul 2011 15:16:38 +0000 (15:16 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@61344 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/canvas/evas_object_textblock.c

index 790b354..afa01ee 100644 (file)
@@ -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;
 }