fix bug that textbox::caret_pos() doesn't move the caret

This commit is contained in:
Jinhao
2017-07-16 21:42:24 +08:00
parent a7bfc61007
commit 822a762804
4 changed files with 46 additions and 12 deletions

View File

@@ -390,6 +390,16 @@ namespace drawerbase {
return editor->hit_text_area(scr_pos);
}
upoint textbox::caret_pos() const
{
auto editor = get_drawer_trigger().editor();
internal_scope_guard lock;
if (editor)
return editor->caret();
return{};
}
textbox& textbox::caret_pos(const upoint& pos)
{
auto editor = get_drawer_trigger().editor();