提交 46097b14 编写于 作者: D Daniel Hritzkiv 提交者: GitHub

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
上级 1c360977
......@@ -5,7 +5,7 @@
import { Audio } from './audio/Audio.js';
import { AudioAnalyser } from './audio/AudioAnalyser.js';
import { PerspectiveCamera } from './cameras/PerspectiveCamera.js';
import { CullFaceFront, CullFaceBack } from './constants.js';
import { CullFaceFront, CullFaceBack, FlatShading } from './constants.js';
import {
Float64BufferAttribute,
Float32BufferAttribute,
......@@ -1047,7 +1047,7 @@ Object.defineProperties( Material.prototype, {
set: function ( value ) {
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;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册