Understand mouse as touch in web

This commit is contained in:
raysan5 2016-03-20 16:28:59 +01:00
parent ebc2b9a286
commit fa78023aa4

View File

@ -1793,6 +1793,8 @@ static void MouseCursorPosCallback(GLFWwindow *window, double x, double y)
// Register touch points position, only one point registered
gestureEvent.position[0] = (Vector2){ (float)x, (float)y };
touchPosition[0] = gestureEvent.position[0];
// Normalize gestureEvent.position[0] for screenWidth and screenHeight
gestureEvent.position[0].x /= (float)GetScreenWidth();
gestureEvent.position[0].y /= (float)GetScreenHeight();