MouseConstraint does not work with pixelRatio above 1
See original GitHub issueWhat
When using pixelRatio: 'auto'
the mouse constraint stops working on retina screens. The shapes “real” position is offset quite a lot, so you have to try to grab them where they are not drawn.
Why
Think that some calculation does not take the pixelRatio into account. Dug around a bit in the source but couldn’t the cause.
Reproduction
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:10 (2 by maintainers)
Top Results From Across the Web
Matter.js Mouse Controls Setup - javascript - Stack Overflow
It doesn't make sense to add a mouse constraint 60 times a second in the rendering loop. · I did that because nothing...
Read more >Matter.Render Module - Matter.js Physics Engine API Docs
Render module is a simple canvas based renderer for visualising instances of Matter. ... If not specified, one will be created if render.element...
Read more >matter-js | Yarn - Package Manager
Important: This documentation covers modern versions of Yarn. For 1.x docs, see classic.yarnpkg.com. Yarn.
Read more >Project 34 - p5.js Web Editor
Others are not essential—they are used for analytics and allow us to learn more about ... const MouseConstraint = Matter. ... pixelRatio =...
Read more >5.21: Matter.js: Mouse Constraints - The Nature of Code
In this video, I demonstrate how to use mouse constraints with matter.js to add mouse interaction to a p5.js physics simulation sketch.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Is anyone still getting this issue? I’m using v0.14.2
This has been solved in commit d577477 but is not yet in a release, it will be included in the next one.