diff --git a/clib.json b/clib.json index a3b05f86..e704fda7 100644 --- a/clib.json +++ b/clib.json @@ -1,6 +1,6 @@ { "name": "nuklear", - "version": "4.12.7", + "version": "4.12.8", "repo": "Immediate-Mode-UI/Nuklear", "description": "A small ANSI C gui toolkit", "keywords": ["gl", "ui", "toolkit"], diff --git a/nuklear.h b/nuklear.h index 71b55a24..7b1fc49d 100644 --- a/nuklear.h +++ b/nuklear.h @@ -8383,7 +8383,7 @@ nk_utf_decode(const char *c, nk_rune *u, int clen) *u = NK_UTF_INVALID; udecoded = nk_utf_decode_byte(c[0], &len); - if (!NK_BETWEEN(len, 1, NK_UTF_SIZE)) + if (!NK_BETWEEN(len, 1, NK_UTF_SIZE+1)) /* +1 because NK_BETWEEN uses strict upper bound ((a) <= (x) && (x) < (b)) */ return 1; for (i = 1, j = 1; i < clen && j < len; ++i, ++j) { @@ -20953,7 +20953,7 @@ nk_window_is_hovered(const struct nk_context *ctx) return 0; else { struct nk_rect actual_bounds = ctx->current->bounds; - if (ctx->begin->flags & NK_WINDOW_MINIMIZED) { + if (ctx->current->flags & NK_WINDOW_MINIMIZED) { actual_bounds.h = ctx->current->layout->header_height; } return nk_input_is_mouse_hovering_rect(&ctx->input, actual_bounds); @@ -30716,6 +30716,8 @@ 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 /// +/// - 2025/09/12 (4.12.8) - Fix nk_window_is_hovered to use current window flags + - Fix nk_utf_decode length check (allow len == NK_UTF_SIZE) /// - 2025/04/06 (4.12.7) - Fix text input navigation and mouse scrolling /// - 2025/03/29 (4.12.6) - Fix unitialized data in nk_input_char /// - 2025/03/05 (4.12.5) - Fix scrolling knob also scrolling parent window, remove dead code diff --git a/src/CHANGELOG b/src/CHANGELOG index 300c3d40..57e628a6 100644 --- a/src/CHANGELOG +++ b/src/CHANGELOG @@ -7,6 +7,8 @@ /// - [y]: Minor version with non-breaking API and library changes /// - [z]: Patch version with no direct changes to the API /// +/// - 2025/09/12 (4.12.8) - Fix nk_window_is_hovered to use current window flags + - Fix nk_utf_decode length check (allow len == NK_UTF_SIZE) /// - 2025/04/06 (4.12.7) - Fix text input navigation and mouse scrolling /// - 2025/03/29 (4.12.6) - Fix unitialized data in nk_input_char /// - 2025/03/05 (4.12.5) - Fix scrolling knob also scrolling parent window, remove dead code diff --git a/src/nuklear_utf8.c b/src/nuklear_utf8.c index 56e0e122..0f390c7b 100644 --- a/src/nuklear_utf8.c +++ b/src/nuklear_utf8.c @@ -47,7 +47,7 @@ nk_utf_decode(const char *c, nk_rune *u, int clen) *u = NK_UTF_INVALID; udecoded = nk_utf_decode_byte(c[0], &len); - if (!NK_BETWEEN(len, 1, NK_UTF_SIZE)) + if (!NK_BETWEEN(len, 1, NK_UTF_SIZE+1)) /* +1 because NK_BETWEEN uses strict upper bound ((a) <= (x) && (x) < (b)) */ return 1; for (i = 1, j = 1; i < clen && j < len; ++i, ++j) { diff --git a/src/nuklear_window.c b/src/nuklear_window.c index 8c286e44..4cd0c19f 100644 --- a/src/nuklear_window.c +++ b/src/nuklear_window.c @@ -436,7 +436,7 @@ nk_window_is_hovered(const struct nk_context *ctx) return 0; else { struct nk_rect actual_bounds = ctx->current->bounds; - if (ctx->begin->flags & NK_WINDOW_MINIMIZED) { + if (ctx->current->flags & NK_WINDOW_MINIMIZED) { actual_bounds.h = ctx->current->layout->header_height; } return nk_input_is_mouse_hovering_rect(&ctx->input, actual_bounds);