0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2025-01-31 18:14:55 -05:00

Fix issues with render pixel ratio for mouse

see #686
This commit is contained in:
Mofasa 2023-11-12 22:38:34 +08:00 committed by GitHub
parent 7ec38a1f1c
commit 1269c9bce6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -34,7 +34,7 @@ var Common = require('../core/Common');
mouse.scale = { x: 1, y: 1 };
mouse.wheelDelta = 0;
mouse.button = -1;
mouse.pixelRatio = parseInt(mouse.element.getAttribute('data-pixel-ratio'), 10) || 1;
mouse.pixelRatio = parseFloat(mouse.element.getAttribute('data-pixel-ratio')) || 1;
mouse.sourceEvents = {
mousemove: null,