Skip to content

Commit

Permalink
Merge pull request #563 from FrostKiwi/fix_click-drag_on_touch
Browse files Browse the repository at this point in the history
Fix click drag on touch + WebBrowsers
  • Loading branch information
RobLoach authored Aug 3, 2023
2 parents 12d4e2b + 71bc457 commit 614abce
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions nuklear.h
Original file line number Diff line number Diff line change
Expand Up @@ -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->down = down;
btn->clicked++;

/* Fix Click-Drag for touch events. */
in->mouse.delta.x = 0;
in->mouse.delta.y = 0;
#ifdef NK_BUTTON_TRIGGER_ON_RELEASE
if (down == 1 && id == NK_BUTTON_LEFT)
{
Expand Down
4 changes: 4 additions & 0 deletions src/nuklear_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -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->down = down;
btn->clicked++;

/* Fix Click-Drag for touch events. */
in->mouse.delta.x = 0;
in->mouse.delta.y = 0;
#ifdef NK_BUTTON_TRIGGER_ON_RELEASE
if (down == 1 && id == NK_BUTTON_LEFT)
{
Expand Down

0 comments on commit 614abce

Please sign in to comment.