Merge pull request #449 from Fra-Ktus/master

allowing touch event to work on iOS and Android
This commit is contained in:
Micha Mettke 2017-06-06 20:40:00 +02:00 committed by GitHub
commit 27603d5b97

View File

@ -319,6 +319,8 @@ nk_sfml_handle_event(sf::Event* evt)
} else if(evt->type == sf::Event::TouchBegan || evt->type == sf::Event::TouchEnded) {
int down = evt->type == sf::Event::TouchBegan;
const int x = evt->touch.x, y = evt->touch.y;
ctx->input.mouse.pos.x = x;
ctx->input.mouse.pos.y = y;
nk_input_button(ctx, NK_BUTTON_LEFT, x, y, down);
return 1;
} else if(evt->type == sf::Event::TouchMoved) {