Skip to content

Commit

Permalink
[unity] Change mouse wheel factor to match better other targets
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyfa committed Nov 21, 2020
1 parent da48130 commit 133626a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions plugins/unity/runtime/src/backend/Screen.hx
Expand Up @@ -98,8 +98,9 @@ class Screen implements tracker.Events #if !completion implements spec.Screen #e
var newMouseX = Input.mousePosition.x;
var newMouseY = height - Input.mousePosition.y;

var mouseScrollX = Math.floor(Input.mouseScrollDelta.x * 32);
var mouseScrollY = Math.floor(Input.mouseScrollDelta.y * 32);
// Use a factor to try to get a consistent value with other targets
var mouseScrollX = Math.floor(Input.mouseScrollDelta.x * 8);
var mouseScrollY = Math.floor(Input.mouseScrollDelta.y * 8);

if (mouseScrollX != 0 || mouseScrollY != 0) {
emitMouseWheel(mouseScrollX, mouseScrollY);
Expand Down

0 comments on commit 133626a

Please sign in to comment.