forked from enlightenment/efl
Evas textblock: Fixed cursor pos set to work correctly in case the character being pointed at is the last character in the last paragraph. Also prevented a bug that may happen with an empty paragraph. Thanks to Mr. Myungjae Lee.
SVN revision: 56020
This commit is contained in:
parent
6502ea96ea
commit
2fd2aaf151
|
@ -5356,15 +5356,17 @@ evas_textblock_cursor_pos_set(Evas_Textblock_Cursor *cur, int _pos)
|
||||||
cur->node = n;
|
cur->node = n;
|
||||||
cur->pos = pos;
|
cur->pos = pos;
|
||||||
}
|
}
|
||||||
else
|
else if (o->text_nodes)
|
||||||
{
|
{
|
||||||
|
/* In case we went pass the last node, we need to put the cursor
|
||||||
|
* at the absolute end. */
|
||||||
Evas_Object_Textblock_Node_Text *last_n;
|
Evas_Object_Textblock_Node_Text *last_n;
|
||||||
|
|
||||||
last_n = _NODE_TEXT(EINA_INLIST_GET(o->text_nodes)->last);
|
last_n = _NODE_TEXT(EINA_INLIST_GET(o->text_nodes)->last);
|
||||||
cur->node = last_n;
|
pos = eina_ustrbuf_length_get(last_n->unicode);
|
||||||
cur->pos = 0;
|
|
||||||
|
|
||||||
evas_textblock_cursor_paragraph_char_last(cur);
|
cur->node = last_n;
|
||||||
|
cur->pos = pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue