Skip to content

Commit 109e9bd

Browse files
committed
fix: use ctx->current->flags instead of ctx->begin->flags when checking state in nk_window_is_hovered
fix: allow len == NK_UTF_SIZE in nk_utf_decode by adjusting NK_BETWEEN upper bound
1 parent 171090c commit 109e9bd

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/nuklear_utf8.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ nk_utf_decode(const char *c, nk_rune *u, int clen)
4747
*u = NK_UTF_INVALID;
4848

4949
udecoded = nk_utf_decode_byte(c[0], &len);
50-
if (!NK_BETWEEN(len, 1, NK_UTF_SIZE))
50+
if (!NK_BETWEEN(len, 1, NK_UTF_SIZE+1)) /* +1 because NK_BETWEEN uses strict upper bound ((a) <= (x) && (x) < (b)) */
5151
return 1;
5252

5353
for (i = 1, j = 1; i < clen && j < len; ++i, ++j) {

src/nuklear_window.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ nk_window_is_hovered(const struct nk_context *ctx)
436436
return 0;
437437
else {
438438
struct nk_rect actual_bounds = ctx->current->bounds;
439-
if (ctx->begin->flags & NK_WINDOW_MINIMIZED) {
439+
if (ctx->current->flags & NK_WINDOW_MINIMIZED) {
440440
actual_bounds.h = ctx->current->layout->header_height;
441441
}
442442
return nk_input_is_mouse_hovering_rect(&ctx->input, actual_bounds);

0 commit comments

Comments
 (0)