aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/views/nodes/PhysicsBox/PhysicsSimulationWeight.tsx20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/client/views/nodes/PhysicsBox/PhysicsSimulationWeight.tsx b/src/client/views/nodes/PhysicsBox/PhysicsSimulationWeight.tsx
index 3ab78e339..30c78cd94 100644
--- a/src/client/views/nodes/PhysicsBox/PhysicsSimulationWeight.tsx
+++ b/src/client/views/nodes/PhysicsBox/PhysicsSimulationWeight.tsx
@@ -187,12 +187,20 @@ export default class Weight extends React.Component<IWeightProps, IState> {
this.setXPosDisplay(xPos);
this.setYVelDisplay(yVel);
this.setXVelDisplay(xVel);
- this.props.dataDoc['accelerationYDisplay'] =
- (-1 * Math.round(this.getNewAccelerationY(this.props.updatedForces) * 100)) / 100
- ;
- this.props.dataDoc['accelerationXDisplay'] =
- Math.round(this.getNewAccelerationX(this.props.updatedForces) * 100) / 100
- ;
+ if (this.props.color == 'red') {
+ this.props.dataDoc['accelerationYDisplay'] =
+ (-1 * Math.round(this.getNewAccelerationY(this.props.updatedForces) * 100)) / 100
+ ;
+ this.props.dataDoc['accelerationXDisplay'] =
+ Math.round(this.getNewAccelerationX(this.props.updatedForces) * 100) / 100
+ ;
+ } else {
+ this.props.dataDoc['accelerationYDisplay2'] =
+ (-1 * Math.round(this.getNewAccelerationY(this.props.updatedForces) * 100)) / 100
+ ;
+ this.props.dataDoc['accelerationXDisplay2'] =
+ Math.round(this.getNewAccelerationX(this.props.updatedForces) * 100) / 100
+ ;}
this.setState({xAccel : (Math.round(this.getNewAccelerationX(this.props.updatedForces) * 100) / 100)})
this.setState({yAccel :