window: Fix hover state when window is minimized (#284)
* Fix hovering check when window is minimized * Align line * window: Fix checking hovering when window is minimized * changelog: Update version in clib.json Fixes #284
This commit is contained in:
parent
0fb7a29712
commit
aa47577bae
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "nuklear",
|
||||
"version": "4.09.3",
|
||||
"version": "4.9.4",
|
||||
"repo": "Immediate-Mode-UI/Nuklear",
|
||||
"description": "A small ANSI C gui toolkit",
|
||||
"keywords": ["gl", "ui", "toolkit"],
|
||||
|
|
15
nuklear.h
15
nuklear.h
|
@ -20446,10 +20446,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)
|
||||
|
@ -22226,7 +22231,7 @@ 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 };
|
||||
|
@ -22236,7 +22241,6 @@ nk_spacer(struct nk_context *ctx )
|
|||
|
||||
|
||||
|
||||
|
||||
/* ===============================================================
|
||||
*
|
||||
* TREE
|
||||
|
@ -29622,6 +29626,7 @@ 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
|
||||
///
|
||||
/// - 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
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
/// - [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.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
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue