aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Hanspeter Portner <dev@open-music-kontrollers.ch>2018-02-26 21:16:39 +0100
committerGravatar Hanspeter Portner <dev@open-music-kontrollers.ch>2018-02-26 21:16:39 +0100
commit97fa4cb28611dae563d8b3956ebcebca6cadf5b0 (patch)
tree4aa1e6d2b0d0ce5d0c8630ab3d43bced58b6485c
parentce00b9f37d5d40902dc29227bc12a66fe1ba8089 (diff)
parentad1d8f0444edc14da545efb5ac5471184b6743f5 (diff)
downloadnuk.lv2-97fa4cb28611dae563d8b3956ebcebca6cadf5b0.zip
nuk.lv2-97fa4cb28611dae563d8b3956ebcebca6cadf5b0.tar.gz
nuk.lv2-97fa4cb28611dae563d8b3956ebcebca6cadf5b0.tar.bz2
nuk.lv2-97fa4cb28611dae563d8b3956ebcebca6cadf5b0.tar.xz
Merge commit 'ad1d8f0444edc14da545efb5ac5471184b6743f5'
-rw-r--r--nuklear/nuklear.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/nuklear/nuklear.h b/nuklear/nuklear.h
index 294964c..274e767 100644
--- a/nuklear/nuklear.h
+++ b/nuklear/nuklear.h
@@ -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) {