瀏覽代碼

Normalize scroll wheel

Brian Peiris 7 年之前
父節點
當前提交
98f84c1b26
共有 1 個文件被更改,包括 3 次插入4 次删除
  1. 3 4
      examples/js/controls/EditorControls.js

+ 3 - 4
examples/js/controls/EditorControls.js

@@ -14,7 +14,7 @@ THREE.EditorControls = function ( object, domElement ) {
 	this.enabled = true;
 	this.center = new THREE.Vector3();
 	this.panSpeed = 0.001;
-	this.zoomSpeed = 0.001;
+	this.zoomSpeed = 0.1;
 	this.rotationSpeed = 0.005;
 
 	// internals
@@ -187,9 +187,8 @@ THREE.EditorControls = function ( object, domElement ) {
 
 		event.preventDefault();
 
-		// if ( scope.enabled === false ) return;
-
-		scope.zoom( new THREE.Vector3( 0, 0, event.deltaY ) );
+		// Normalize deltaY due to https://bugzilla.mozilla.org/show_bug.cgi?id=1392460
+		scope.zoom( new THREE.Vector3( 0, 0, event.deltaY > 0 ? 1 : - 1 ) );
 
 	}