diff --git a/clib.json b/clib.json index 20e4b9e..88e8d41 100644 --- a/clib.json +++ b/clib.json @@ -1,6 +1,6 @@ { "name": "nuklear", - "version": "4.09.1", + "version": "4.9.5", "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 a4e772c..6699d61 100644 --- a/nuklear.h +++ b/nuklear.h @@ -20444,10 +20444,15 @@ nk_window_is_hovered(struct nk_context *ctx) { NK_ASSERT(ctx); NK_ASSERT(ctx->current); - if (!ctx || !ctx->current) return 0; - if(ctx->current->flags & NK_WINDOW_HIDDEN) + if (!ctx || !ctx->current || (ctx->current->flags & NK_WINDOW_HIDDEN)) return 0; - return nk_input_is_mouse_hovering_rect(&ctx->input, ctx->current->bounds); + else { + struct nk_rect actual_bounds = ctx->current->bounds; + if (ctx->begin->flags & NK_WINDOW_MINIMIZED) { + actual_bounds.h = ctx->current->layout->header_height; + } + return nk_input_is_mouse_hovering_rect(&ctx->input, actual_bounds); + } } NK_API nk_bool nk_window_is_any_hovered(struct nk_context *ctx) @@ -22234,7 +22239,6 @@ nk_spacer(struct nk_context *ctx ) - /* =============================================================== * * TREE @@ -29613,14 +29617,16 @@ nk_tooltipfv(struct nk_context *ctx, const char *fmt, va_list args) /// ## Changelog /// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~none -/// [date][x.yy.zz]-[description] -/// -[date]: date on which the change has been pushed -/// -[x.yy.zz]: Numerical version string representation. Each version number on the right -/// resets back to zero if version on the left is incremented. -/// - [x]: Major version with API and library breaking changes -/// - [yy]: Minor version with non-breaking API and library changes -/// - [zz]: Bug fix version with no direct changes to API +/// [date] ([x.y.z]) - [description] +/// - [date]: date on which the change has been pushed +/// - [x.y.z]: Version string, represented in Semantic Versioning format +/// - [x]: Major version with API and library breaking changes +/// - [y]: Minor version with non-breaking API and library changes +/// - [z]: Patch version with no direct changes to the API /// +/// - 2021/12/22 (4.9.5) - Revert layout bounds not accounting for padding due to regressions +/// - 2021/12/22 (4.9.4) - Fix checking hovering when window is minimized +/// - 2021/12/22 (4.09.3) - Fix layout bounds not accounting for padding /// - 2021/12/19 (4.09.2) - Update to stb_rect_pack.h v1.01 and stb_truetype.h v1.26 /// - 2021/12/16 (4.09.1) - Fix the majority of GCC warnings /// - 2021/10/16 (4.09.0) - Added nk_spacer() widget diff --git a/src/CHANGELOG b/src/CHANGELOG index 3595944..bbd956f 100644 --- a/src/CHANGELOG +++ b/src/CHANGELOG @@ -1,13 +1,15 @@ /// ## Changelog /// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~none -/// [date][x.yy.zz]-[description] -/// -[date]: date on which the change has been pushed -/// -[x.yy.zz]: Numerical version string representation. Each version number on the right -/// resets back to zero if version on the left is incremented. -/// - [x]: Major version with API and library breaking changes -/// - [yy]: Minor version with non-breaking API and library changes -/// - [zz]: Bug fix version with no direct changes to API +/// [date] ([x.y.z]) - [description] +/// - [date]: date on which the change has been pushed +/// - [x.y.z]: Version string, represented in Semantic Versioning format +/// - [x]: Major version with API and library breaking changes +/// - [y]: Minor version with non-breaking API and library changes +/// - [z]: Patch version with no direct changes to the API /// +/// - 2021/12/22 (4.9.5) - Revert layout bounds not accounting for padding due to regressions +/// - 2021/12/22 (4.9.4) - Fix checking hovering when window is minimized +/// - 2021/12/22 (4.09.3) - Fix layout bounds not accounting for padding /// - 2021/12/19 (4.09.2) - Update to stb_rect_pack.h v1.01 and stb_truetype.h v1.26 /// - 2021/12/16 (4.09.1) - Fix the majority of GCC warnings /// - 2021/10/16 (4.09.0) - Added nk_spacer() widget diff --git a/src/nuklear_layout.c b/src/nuklear_layout.c index 269cfd4..0229bd0 100644 --- a/src/nuklear_layout.c +++ b/src/nuklear_layout.c @@ -760,10 +760,9 @@ nk_layout_peek(struct nk_rect *bounds, struct nk_context *ctx) layout->at_y = y; layout->row.index = index; } -NK_API void +NK_API void nk_spacer(struct nk_context *ctx ) { struct nk_rect dummy_rect = { 0, 0, 0, 0 }; nk_panel_alloc_space( &dummy_rect, ctx ); } - diff --git a/src/nuklear_window.c b/src/nuklear_window.c index 558ebce..486b912 100644 --- a/src/nuklear_window.c +++ b/src/nuklear_window.c @@ -431,10 +431,15 @@ nk_window_is_hovered(struct nk_context *ctx) { NK_ASSERT(ctx); NK_ASSERT(ctx->current); - if (!ctx || !ctx->current) return 0; - if(ctx->current->flags & NK_WINDOW_HIDDEN) + if (!ctx || !ctx->current || (ctx->current->flags & NK_WINDOW_HIDDEN)) return 0; - return nk_input_is_mouse_hovering_rect(&ctx->input, ctx->current->bounds); + else { + struct nk_rect actual_bounds = ctx->current->bounds; + if (ctx->begin->flags & NK_WINDOW_MINIMIZED) { + actual_bounds.h = ctx->current->layout->header_height; + } + return nk_input_is_mouse_hovering_rect(&ctx->input, actual_bounds); + } } NK_API nk_bool nk_window_is_any_hovered(struct nk_context *ctx)