Browse Source

Merge pull request #7280 from leitzler/leitzler-retina

Fix for retina displays (see #7272)
Mr.doob 9 years ago
parent
commit
c245fb7fe9
1 changed files with 2 additions and 3 deletions
  1. 2 3
      examples/webgl_geometry_terrain_raycast.html

+ 2 - 3
examples/webgl_geometry_terrain_raycast.html

@@ -252,9 +252,8 @@
 
 
 			function onMouseMove( event ) {
 			function onMouseMove( event ) {
 
 
-				mouse.x = ( event.clientX / renderer.domElement.width ) * 2 - 1;
-				mouse.y = - ( event.clientY / renderer.domElement.height ) * 2 + 1;
-
+				mouse.x = ( event.clientX / renderer.domElement.clientWidth ) * 2 - 1;
+				mouse.y = - ( event.clientY / renderer.domElement.clientHeight ) * 2 + 1;
 				raycaster.setFromCamera( mouse, camera );
 				raycaster.setFromCamera( mouse, camera );
 
 
 				// See if the ray from the camera into the world hits one of our meshes
 				// See if the ray from the camera into the world hits one of our meshes