浏览代码

reference `FlatShading` directly; Use comparison result directly

Importing `FlatShading` from ./constants directly, instead of accessing it from `THREE`.

and `value === FlatShading` resolves to a boolean, so no need for a ternary operation
Daniel Hritzkiv 8 年之前
父节点
当前提交
46097b1441
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/Three.Legacy.js

+ 2 - 2
src/Three.Legacy.js

@@ -5,7 +5,7 @@
 import { Audio } from './audio/Audio.js';
 import { Audio } from './audio/Audio.js';
 import { AudioAnalyser } from './audio/AudioAnalyser.js';
 import { AudioAnalyser } from './audio/AudioAnalyser.js';
 import { PerspectiveCamera } from './cameras/PerspectiveCamera.js';
 import { PerspectiveCamera } from './cameras/PerspectiveCamera.js';
-import { CullFaceFront, CullFaceBack } from './constants.js';
+import { CullFaceFront, CullFaceBack, FlatShading } from './constants.js';
 import {
 import {
 	Float64BufferAttribute,
 	Float64BufferAttribute,
 	Float32BufferAttribute,
 	Float32BufferAttribute,
@@ -1047,7 +1047,7 @@ Object.defineProperties( Material.prototype, {
 		set: function ( value ) {
 		set: function ( value ) {
 
 
 			console.warn( 'THREE.' + this.type + ': .shading has been removed. Use the boolean .flatShading instead.' );
 			console.warn( 'THREE.' + this.type + ': .shading has been removed. Use the boolean .flatShading instead.' );
-			this.flatShading = ( value === THREE.FlatShading ) ? true : false;
+			this.flatShading = value === FlatShading;
 
 
 		}
 		}
 	}
 	}