Skip to content

Commit

Permalink
fix Matter.Mouse when element does not have fixed dimensions, closes #73
Browse files Browse the repository at this point in the history
  • Loading branch information
liabru committed Jun 25, 2016
1 parent faf534a commit 1340159
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/Mouse.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
};
};

Expand Down

0 comments on commit 1340159

Please sign in to comment.