Skip to content

Commit 1374197

Browse files
committed
Update source code too
1 parent e562d1b commit 1374197

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/nuklear_widget.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ nk_widget_is_hovered(const struct nk_context *ctx)
7272
struct nk_rect bounds;
7373
NK_ASSERT(ctx);
7474
NK_ASSERT(ctx->current);
75-
if (!ctx || !ctx->current || ctx->active != ctx->current)
75+
NK_ASSERT(ctx->current->layout);
76+
if (!ctx || !ctx->current || !ctx->current->layout || (ctx->active != ctx->current && !((int)ctx->current->layout->type & (int)NK_PANEL_SET_POPUP)))
7677
return 0;
7778

7879
c = ctx->current->layout->clip;
@@ -94,7 +95,8 @@ nk_widget_is_mouse_clicked(const struct nk_context *ctx, enum nk_buttons btn)
9495
struct nk_rect bounds;
9596
NK_ASSERT(ctx);
9697
NK_ASSERT(ctx->current);
97-
if (!ctx || !ctx->current || ctx->active != ctx->current)
98+
NK_ASSERT(ctx->current->layout);
99+
if (!ctx || !ctx->current || !ctx->current->layout || (ctx->active != ctx->current && !((int)ctx->current->layout->type & (int)NK_PANEL_SET_POPUP)))
98100
return 0;
99101

100102
c = ctx->current->layout->clip;
@@ -116,7 +118,8 @@ nk_widget_has_mouse_click_down(const struct nk_context *ctx, enum nk_buttons btn
116118
struct nk_rect bounds;
117119
NK_ASSERT(ctx);
118120
NK_ASSERT(ctx->current);
119-
if (!ctx || !ctx->current || ctx->active != ctx->current)
121+
NK_ASSERT(ctx->current->layout);
122+
if (!ctx || !ctx->current || !ctx->current->layout || (ctx->active != ctx->current && !((int)ctx->current->layout->type & (int)NK_PANEL_SET_POPUP)))
120123
return 0;
121124

122125
c = ctx->current->layout->clip;

0 commit comments

Comments
 (0)