Merge branch 'master' of github.com:Immediate-Mode-UI/Nuklear into revert-156-fix-layout-bounds-padding

This commit is contained in:
Rob Loach 2021-12-24 15:11:28 -05:00
commit 878936f476
No known key found for this signature in database
GPG Key ID: 627C60834A74A21A
5 changed files with 36 additions and 24 deletions

View File

@ -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"],

View File

@ -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

View File

@ -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

View File

@ -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 );
}

View File

@ -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)