0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2024-11-27 09:50:52 -05:00

fix Matter.Mouse when element does not have fixed dimensions, closes #73

This commit is contained in:
liabru 2016-06-25 17:34:28 +01:00
parent faf534ad1f
commit 1340159451

View file

@ -193,8 +193,8 @@ var Common = require('../core/Common');
}
return {
x: x / (element.clientWidth / element.width * pixelRatio),
y: y / (element.clientHeight / element.height * pixelRatio)
x: x / (element.clientWidth / (element.width || element.clientWidth) * pixelRatio),
y: y / (element.clientHeight / (element.height || element.clientHeight) * pixelRatio)
};
};