瀏覽代碼

Fix quaternion update bug

David `Deltakosh` Catuhe 5 年之前
父節點
當前提交
65ff2a3664
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      inspector/src/components/actionTabs/lines/quaternionLineComponent.tsx

+ 2 - 1
inspector/src/components/actionTabs/lines/quaternionLineComponent.tsx

@@ -27,11 +27,12 @@ export class QuaternionLineComponent extends React.Component<IQuaternionLineComp
         this.state = { isExpanded: false, value: quat, eulerValue: quat.toEulerAngles() }
     }
 
-    shouldComponentUpdate(nextProps: IQuaternionLineComponentProps, nextState: { isExpanded: boolean, value: Quaternion }) {
+    shouldComponentUpdate(nextProps: IQuaternionLineComponentProps, nextState: { isExpanded: boolean, value: Quaternion, eulerValue: Vector3 }) {
         const nextPropsValue = nextProps.target[nextProps.propertyName];
 
         if (!nextPropsValue.equals(nextState.value) || this._localChange) {
             nextState.value = nextPropsValue.clone();
+            nextState.eulerValue = nextPropsValue.toEulerAngles();
             this._localChange = false;
             return true;
         }