Skip to content

Commit 9060ac7

Browse files
authored
Mouse delta calculation with scaling (#5779)
Added scaling from SetMouseScale to mouse GetMouseDelta
1 parent 4ced756 commit 9060ac7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/rcore.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4125,8 +4125,8 @@ Vector2 GetMouseDelta(void)
41254125
{
41264126
Vector2 delta = { 0 };
41274127

4128-
delta.x = CORE.Input.Mouse.currentPosition.x - CORE.Input.Mouse.previousPosition.x;
4129-
delta.y = CORE.Input.Mouse.currentPosition.y - CORE.Input.Mouse.previousPosition.y;
4128+
delta.x = (CORE.Input.Mouse.currentPosition.x - CORE.Input.Mouse.previousPosition.x)*CORE.Input.Mouse.scale.x;
4129+
delta.y = (CORE.Input.Mouse.currentPosition.y - CORE.Input.Mouse.previousPosition.y)*CORE.Input.Mouse.scale.y;
41304130

41314131
return delta;
41324132
}

0 commit comments

Comments
 (0)