Skip to content

Commit

Permalink
Fixed mouse/touch position when using the retina option
Browse files Browse the repository at this point in the history
  • Loading branch information
filR committed Oct 15, 2015
1 parent 9dd3c97 commit 5493783
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions js/sketch.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,13 @@
touch.x = touch.pageX - bounds.left - (win.scrollX || win.pageXOffset);
touch.y = touch.pageY - bounds.top - (win.scrollY || win.pageYOffset);

if ( context.retina && is2D && ratio ) {

touch.x *= ratio;
touch.y *= ratio;

}

return touch;
}

Expand Down

0 comments on commit 5493783

Please sign in to comment.