Skip to content

Commit

Permalink
Merge pull request #482 from MetaCell/feature/481
Browse files Browse the repository at this point in the history
#481 fix: Backport retina displays fix
  • Loading branch information
enicolasgomez authored Feb 1, 2023
2 parents 16efe76 + bd479ca commit e4b1696
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ export default class ThreeDEngine {
this.setupListeners(onSelection);

this.start = this.start.bind(this);
this.stop = this.stop.bind(this);
this.animate = this.animate.bind(this);
this.renderScene = this.renderScene.bind(this);
this.stop = this.stop.bind(this);
this.resize = this.resize.bind(this);
}

Expand Down Expand Up @@ -730,14 +730,14 @@ export default class ThreeDEngine {
that.mouse.y
= -(
(event.clientY
- that.renderer.domElement.getBoundingClientRect().top)
- that.renderer.domElement.getBoundingClientRect().top) * window.devicePixelRatio
/ that.renderer.domElement.getBoundingClientRect().height
)
* 2
+ 1;
that.mouse.x
= ((event.clientX
- that.renderer.domElement.getBoundingClientRect().left)
- that.renderer.domElement.getBoundingClientRect().left) * window.devicePixelRatio
/ that.renderer.domElement.getBoundingClientRect().width)
* 2
- 1;
Expand Down Expand Up @@ -821,14 +821,14 @@ export default class ThreeDEngine {
that.mouse.y
= -(
(event.clientY
- that.renderer.domElement.getBoundingClientRect().top)
- that.renderer.domElement.getBoundingClientRect().top) * window.devicePixelRatio
/ that.renderer.domElement.height
)
* 2
+ 1;
that.mouse.x
= ((event.clientX
- that.renderer.domElement.getBoundingClientRect().left)
- that.renderer.domElement.getBoundingClientRect().left) * window.devicePixelRatio
/ that.renderer.domElement.width)
* 2
- 1;
Expand Down

0 comments on commit e4b1696

Please sign in to comment.