mirror of
https://github.com/liabru/matter-js.git
synced 2025-01-13 16:18:50 -05:00
parent
07aec9ff5e
commit
e888f3cfda
1 changed files with 8 additions and 9 deletions
|
@ -116,16 +116,15 @@ var Common = require('../core/Common');
|
||||||
Mouse.setElement = function(mouse, element) {
|
Mouse.setElement = function(mouse, element) {
|
||||||
mouse.element = element;
|
mouse.element = element;
|
||||||
|
|
||||||
element.addEventListener('mousemove', mouse.mousemove);
|
element.addEventListener('mousemove', mouse.mousemove, { passive: true });
|
||||||
element.addEventListener('mousedown', mouse.mousedown);
|
element.addEventListener('mousedown', mouse.mousedown, { passive: true });
|
||||||
element.addEventListener('mouseup', mouse.mouseup);
|
element.addEventListener('mouseup', mouse.mouseup, { passive: true });
|
||||||
|
|
||||||
element.addEventListener('mousewheel', mouse.mousewheel);
|
element.addEventListener('wheel', mouse.mousewheel, { passive: false });
|
||||||
element.addEventListener('DOMMouseScroll', mouse.mousewheel);
|
|
||||||
|
element.addEventListener('touchmove', mouse.mousemove, { passive: false });
|
||||||
element.addEventListener('touchmove', mouse.mousemove);
|
element.addEventListener('touchstart', mouse.mousedown, { passive: false });
|
||||||
element.addEventListener('touchstart', mouse.mousedown);
|
element.addEventListener('touchend', mouse.mouseup, { passive: false });
|
||||||
element.addEventListener('touchend', mouse.mouseup);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue