From 13401594516a6fe4b4e2c9f8129089613cda1ce0 Mon Sep 17 00:00:00 2001 From: liabru Date: Sat, 25 Jun 2016 17:34:28 +0100 Subject: [PATCH] fix Matter.Mouse when element does not have fixed dimensions, closes #73 --- src/core/Mouse.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/Mouse.js b/src/core/Mouse.js index 5c433f78..53e2695a 100644 --- a/src/core/Mouse.js +++ b/src/core/Mouse.js @@ -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) }; };