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:
parent
faf534ad1f
commit
1340159451
1 changed files with 2 additions and 2 deletions
|
@ -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)
|
||||
};
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue