Fix nuklear input processing

This commit is contained in:
2023-11-09 06:21:29 +01:00
parent aa9fe8fa9a
commit 4458a26c4f
2 changed files with 20 additions and 11 deletions

View File

@@ -692,10 +692,12 @@ NK_API void nk_raylib_input_mouse(struct nk_context * ctx)
// Mouse Wheel
float mouseWheel = GetMouseWheelMove();
if (mouseWheel != 0.0f) {
struct nk_vec2 mouseWheelMove;
mouseWheelMove.x = 0.0f;
mouseWheelMove.y = mouseWheel;
nk_input_scroll(ctx, mouseWheelMove);
if (nk_input_is_mouse_hovering_rect(&ctx->input, ctx->active->bounds)) {
struct nk_vec2 mouseWheelMove;
mouseWheelMove.x = 0.0f;
mouseWheelMove.y = mouseWheel;
nk_input_scroll(ctx, mouseWheelMove);
}
}
}