0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2024-12-25 13:39:06 -05:00

fixed issue with Matter.Mouse

This commit is contained in:
liabru 2014-05-01 11:52:50 +01:00
parent 3750bfc719
commit 77168e5faf

View file

@ -36,7 +36,8 @@ var Mouse;
event.preventDefault(); event.preventDefault();
} }
mouse.position = position; mouse.position.x = position.x;
mouse.position.y = position.y;
mouse.sourceEvents.mousemove = event; mouse.sourceEvents.mousemove = event;
}; };
@ -51,7 +52,10 @@ var Mouse;
mouse.button = event.button; mouse.button = event.button;
} }
mouse.position = mouse.mousedownPosition = position; mouse.position.x = position.x;
mouse.position.y = position.y;
mouse.mousedownPosition.x = position.x;
mouse.mousedownPosition.y = position.y;
mouse.sourceEvents.mousedown = event; mouse.sourceEvents.mousedown = event;
}; };
@ -64,7 +68,10 @@ var Mouse;
} }
mouse.button = -1; mouse.button = -1;
mouse.position = mouse.mouseupPosition = position; mouse.position.x = position.x;
mouse.position.y = position.y;
mouse.mouseupPosition.x = position.x;
mouse.mouseupPosition.y = position.y;
mouse.sourceEvents.mouseup = event; mouse.sourceEvents.mouseup = event;
}; };