Skip to content

Commit

Permalink
Fix a bug where combobox cannot be closed by clicking the header when…
Browse files Browse the repository at this point in the history
… NK_BUTTON_TRIGGER_ON_RELEASE is defined
  • Loading branch information
eax0r authored Sep 20, 2019
1 parent c43600b commit ea375a1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/nuklear_popup.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,11 @@ nk_nonblock_begin(struct nk_context *ctx,
} else {
/* close the popup if user pressed outside or in the header */
int pressed, in_body, in_header;
#ifdef NK_BUTTON_TRIGGER_ON_RELEASE
pressed = nk_input_is_mouse_released(&ctx->input, NK_BUTTON_LEFT);
#else
pressed = nk_input_is_mouse_pressed(&ctx->input, NK_BUTTON_LEFT);
#endif
in_body = nk_input_is_mouse_hovering_rect(&ctx->input, body);
in_header = nk_input_is_mouse_hovering_rect(&ctx->input, header);
if (pressed && (!in_body || in_header))
Expand Down

0 comments on commit ea375a1

Please sign in to comment.