Evas textblock: Fixed issue with char/line_coord_set with valign. #2.
authortasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 14 Jul 2011 08:00:23 +0000 (08:00 +0000)
committertasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 14 Jul 2011 08:00:23 +0000 (08:00 +0000)
After adding some tests, I found out that my previous fix was not enough.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/evas@61362 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/canvas/evas_object_textblock.c

index d7d3dc3..6d01ad1 100644 (file)
@@ -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);