瀏覽代碼

Merge pull request #9066 from BabylonJS/msDestiny14/nme

NME - Fixing Bug in Color4
David Catuhe 4 年之前
父節點
當前提交
742dd76440
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      nodeEditor/src/sharedComponents/color4LineComponent.tsx

+ 2 - 2
nodeEditor/src/sharedComponents/color4LineComponent.tsx

@@ -30,8 +30,8 @@ export class Color4LineComponent extends React.Component<IColor4LineComponentPro
     }
 
     shouldComponentUpdate(nextProps: IColor4LineComponentProps, nextState: { color: Color4 }) {
-        let value = this.props.target[this.props.propertyName];
-        let currentColor = value.getClassName() === "Color4" ? value : new Color4(value.r, value.g, value.b, 1.0);
+        const currentState = nextProps.target[nextProps.propertyName];
+        let currentColor = currentState.getClassName() === "Color4" ? currentState : new Color4(currentState.r, currentState.g, currentState.b, 1.0);  
 
         if (!currentColor.equals(nextState.color) || this._localChange) {
             nextState.color = currentColor.clone();