Skip to content

Commit

Permalink
improve text edit
Browse files Browse the repository at this point in the history
  • Loading branch information
xianjimli committed Nov 8, 2024
1 parent 7ef0b6d commit 4846d52
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

2024/11/08
* 去除克隆combo_box时不必要的打印信息(感谢雨欣提供补丁)
* 修复edit在一些情况下没有layout的问题(感谢泽武提供补丁)

2024/11/07
* 修复locale_infos_unref接口释放info对象无法清除assets_manager上的野指针导致崩溃的问题(感谢雨欣提供补丁)
Expand Down
8 changes: 6 additions & 2 deletions src/base/text_edit.c
Original file line number Diff line number Diff line change
Expand Up @@ -2115,8 +2115,12 @@ ret_t text_edit_set_cursor(text_edit_t* text_edit, uint32_t cursor) {

if (impl->state.cursor != cursor) {
impl->state.cursor = cursor;
text_edit_update_caret_pos(text_edit);
text_edit_update_input_rect(text_edit);
if (impl->single_line) {
text_edit_layout(text_edit);
} else {
text_edit_update_caret_pos(text_edit);
text_edit_update_input_rect(text_edit);
}
}

return RET_OK;
Expand Down

0 comments on commit 4846d52

Please sign in to comment.