Merge pull request #563 from FrostKiwi/fix_click-drag_on_touch

Fix click drag on touch + WebBrowsers
This commit is contained in:
Rob Loach 2023-08-03 11:50:52 -04:00 committed by GitHub
commit 614abce05b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -17897,6 +17897,10 @@ nk_input_button(struct nk_context *ctx, enum nk_buttons id, int x, int y, nk_boo
btn->clicked_pos.y = (float)y; btn->clicked_pos.y = (float)y;
btn->down = down; btn->down = down;
btn->clicked++; btn->clicked++;
/* Fix Click-Drag for touch events. */
in->mouse.delta.x = 0;
in->mouse.delta.y = 0;
#ifdef NK_BUTTON_TRIGGER_ON_RELEASE #ifdef NK_BUTTON_TRIGGER_ON_RELEASE
if (down == 1 && id == NK_BUTTON_LEFT) if (down == 1 && id == NK_BUTTON_LEFT)
{ {

View File

@ -83,6 +83,10 @@ nk_input_button(struct nk_context *ctx, enum nk_buttons id, int x, int y, nk_boo
btn->clicked_pos.y = (float)y; btn->clicked_pos.y = (float)y;
btn->down = down; btn->down = down;
btn->clicked++; btn->clicked++;
/* Fix Click-Drag for touch events. */
in->mouse.delta.x = 0;
in->mouse.delta.y = 0;
#ifdef NK_BUTTON_TRIGGER_ON_RELEASE #ifdef NK_BUTTON_TRIGGER_ON_RELEASE
if (down == 1 && id == NK_BUTTON_LEFT) if (down == 1 && id == NK_BUTTON_LEFT)
{ {