Commit 4063076d authored by Hanspeter Portner's avatar Hanspeter Portner

Squashed 'nuklear/' changes from 2d8b6dc..645013d

645013d omk: retain history and scroll-state in textedit.

git-subtree-dir: nuklear
git-subtree-split: 645013da47729ec24a5e1ecca9dc78391b98b764
parent ea554933
......@@ -14809,6 +14809,16 @@ nk_textedit_clear_state(struct nk_text_edit *state, enum nk_text_edit_type type,
state->scrollbar = nk_vec2(0,0);
}
NK_INTERN void
nk_textedit_reset_state(struct nk_text_edit *state, enum nk_text_edit_type type,
nk_plugin_filter filter)
{
/* reset the state to default */
state->single_line = (unsigned char)(type == NK_TEXT_EDIT_SINGLE_LINE);
state->mode = NK_TEXT_EDIT_MODE_VIEW;
state->filter = filter;
}
NK_API void
nk_textedit_init_fixed(struct nk_text_edit *state, void *memory, nk_size size)
{
......@@ -16571,7 +16581,7 @@ nk_do_edit(nk_flags *state, struct nk_command_buffer *out,
if (!prev_state && edit->active) {
const enum nk_text_edit_type type = (flags & NK_EDIT_MULTILINE) ?
NK_TEXT_EDIT_MULTI_LINE: NK_TEXT_EDIT_SINGLE_LINE;
nk_textedit_clear_state(edit, type, filter);
nk_textedit_reset_state(edit, type, filter);
if (flags & NK_EDIT_AUTO_SELECT)
select_all = nk_true;
if (flags & NK_EDIT_GOTO_END_ON_ACTIVATE) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment