Understand mouse as touch in web
This commit is contained in:
parent
ebc2b9a286
commit
fa78023aa4
1 changed files with 2 additions and 0 deletions
|
@ -1793,6 +1793,8 @@ static void MouseCursorPosCallback(GLFWwindow *window, double x, double y)
|
||||||
// Register touch points position, only one point registered
|
// Register touch points position, only one point registered
|
||||||
gestureEvent.position[0] = (Vector2){ (float)x, (float)y };
|
gestureEvent.position[0] = (Vector2){ (float)x, (float)y };
|
||||||
|
|
||||||
|
touchPosition[0] = gestureEvent.position[0];
|
||||||
|
|
||||||
// Normalize gestureEvent.position[0] for screenWidth and screenHeight
|
// Normalize gestureEvent.position[0] for screenWidth and screenHeight
|
||||||
gestureEvent.position[0].x /= (float)GetScreenWidth();
|
gestureEvent.position[0].x /= (float)GetScreenWidth();
|
||||||
gestureEvent.position[0].y /= (float)GetScreenHeight();
|
gestureEvent.position[0].y /= (float)GetScreenHeight();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue