question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MouseConstraint does not work with pixelRatio above 1

See original GitHub issue

What

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

https://codesandbox.io/s/nkm7pzmvn0

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
richgcookcommented, Sep 25, 2019

Is anyone still getting this issue? I’m using v0.14.2

2reactions
liabrucommented, Jun 5, 2019

This has been solved in commit d577477 but is not yet in a release, it will be included in the next one.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found