Evas textblock: Fixed 'up' and 'down' when pointing to the end of the last line when...
authortasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 29 Aug 2010 09:19:04 +0000 (09:19 +0000)
committertasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 29 Aug 2010 09:19:04 +0000 (09:19 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/evas@51717 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/canvas/evas_object_textblock.c

index 9c43ed1..7d2fd1a 100644 (file)
@@ -6550,6 +6550,7 @@ evas_textblock_cursor_line_geometry_get(const Evas_Textblock_Cursor *cur, Evas_C
    Evas_Object_Textblock_Line *ln = NULL;
    Evas_Object_Textblock_Item *it = NULL;
    Evas_Object_Textblock_Format_Item *fi = NULL;
+   Evas_Textblock_Cursor cur2;
    int x, y, w, h;
 
    if (!cur) return -1;
@@ -6561,6 +6562,14 @@ evas_textblock_cursor_line_geometry_get(const Evas_Textblock_Cursor *cur, Evas_C
      }
    else
      {
+        /* Cur 2 is pointing to the previous char */
+        cur2.obj = cur->obj;
+        evas_textblock_cursor_copy(cur, &cur2);
+        if (cur2.pos > 0)
+          {
+             cur2.pos--;
+          }
+
         if (evas_textblock_cursor_format_is_visible_get(cur))
           {
              _find_layout_format_item_line_match(cur->obj,
@@ -6568,6 +6577,14 @@ evas_textblock_cursor_line_geometry_get(const Evas_Textblock_Cursor *cur, Evas_C
                       _evas_textblock_cursor_node_format_at_pos_get(cur)),
                    &ln, &fi);
           }
+        else if (_evas_textblock_cursor_is_at_the_end(cur) &&
+              evas_textblock_cursor_format_is_visible_get(&cur2))
+          {
+             _find_layout_format_item_line_match(cur->obj,
+                   _evas_textblock_node_visible_at_pos_get(
+                      _evas_textblock_cursor_node_format_at_pos_get(&cur2)),
+                   &ln, &fi);
+          }
         else
           {
              _find_layout_item_line_match(cur->obj, cur->node, cur->pos, &ln, &it);