diff --git a/clib.json b/clib.json index 27c495f..3fe7d63 100644 --- a/clib.json +++ b/clib.json @@ -1,6 +1,6 @@ { "name": "nuklear", - "version": "4.9.6", + "version": "4.10.1", "repo": "Immediate-Mode-UI/Nuklear", "description": "A small ANSI C gui toolkit", "keywords": ["gl", "ui", "toolkit"], diff --git a/demo/x11_opengl2/main.c b/demo/x11_opengl2/main.c index e751eef..5145c3b 100644 --- a/demo/x11_opengl2/main.c +++ b/demo/x11_opengl2/main.c @@ -172,6 +172,7 @@ int main(void) glXGetFBConfigAttrib(win.dpy, fbc[i], GLX_SAMPLES, &samples); if ((fb_best < 0) || (sample_buffer && samples > best_num_samples)) fb_best = i, best_num_samples = samples; + XFree(vi); } } win.fbc = fbc[fb_best]; diff --git a/demo/x11_opengl3/main.c b/demo/x11_opengl3/main.c index 7e415b5..faaad12 100644 --- a/demo/x11_opengl3/main.c +++ b/demo/x11_opengl3/main.c @@ -170,6 +170,7 @@ int main(void) glXGetFBConfigAttrib(win.dpy, fbc[i], GLX_SAMPLES, &samples); if ((fb_best < 0) || (sample_buffer && samples > best_num_samples)) fb_best = i, best_num_samples = samples; + XFree(vi); } } win.fbc = fbc[fb_best]; diff --git a/nuklear.h b/nuklear.h index 901d3e5..a6cff96 100644 --- a/nuklear.h +++ b/nuklear.h @@ -26162,7 +26162,7 @@ nk_textedit_text(struct nk_text_edit *state, const char *text, int total_len) text+text_len, 1)) { nk_textedit_makeundo_insert(state, state->cursor, 1); - ++state->cursor; + state->cursor = NK_MIN(state->cursor + 1, state->string.len); state->has_preferred_x = 0; } } @@ -29656,7 +29656,9 @@ nk_tooltipfv(struct nk_context *ctx, const char *fmt, va_list args) /// - [y]: Minor version with non-breaking API and library changes /// - [z]: Patch version with no direct changes to the API /// -/// - 2022/07/30 (4.10.1) - Renamed the `null` texture variable to `tex_null` +/// - 2022/08/03 (4.10.2) - Renamed the `null` texture variable to `tex_null` +/// - 2022/08/01 (4.10.1) - Fix cursor jumping back to beginning of text when typing more than +/// nk_edit_xxx limit /// - 2022/05/27 (4.10.0) - Add nk_input_has_mouse_click_in_button_rect() to fix window move bug /// - 2022/04/18 (4.9.7) - Change button behavior when NK_BUTTON_TRIGGER_ON_RELEASE is defined to /// only trigger when the mouse position was inside the same button on down diff --git a/src/CHANGELOG b/src/CHANGELOG index 619468c..fb89d6d 100644 --- a/src/CHANGELOG +++ b/src/CHANGELOG @@ -7,7 +7,9 @@ /// - [y]: Minor version with non-breaking API and library changes /// - [z]: Patch version with no direct changes to the API /// -/// - 2022/07/30 (4.10.1) - Renamed the `null` texture variable to `tex_null` +/// - 2022/08/03 (4.10.2) - Renamed the `null` texture variable to `tex_null` +/// - 2022/08/01 (4.10.1) - Fix cursor jumping back to beginning of text when typing more than +/// nk_edit_xxx limit /// - 2022/05/27 (4.10.0) - Add nk_input_has_mouse_click_in_button_rect() to fix window move bug /// - 2022/04/18 (4.9.7) - Change button behavior when NK_BUTTON_TRIGGER_ON_RELEASE is defined to /// only trigger when the mouse position was inside the same button on down diff --git a/src/nuklear_text_editor.c b/src/nuklear_text_editor.c index 5b0c03a..e381857 100644 --- a/src/nuklear_text_editor.c +++ b/src/nuklear_text_editor.c @@ -394,7 +394,7 @@ nk_textedit_text(struct nk_text_edit *state, const char *text, int total_len) text+text_len, 1)) { nk_textedit_makeundo_insert(state, state->cursor, 1); - ++state->cursor; + state->cursor = NK_MIN(state->cursor + 1, state->string.len); state->has_preferred_x = 0; } }