From 09f61f8d1e10de81f6f5d18ff372744715aa62c4 Mon Sep 17 00:00:00 2001
From: brynnchernosky <56202540+brynnchernosky@users.noreply.github.com>
Date: Thu, 4 May 2023 21:16:36 -0400
Subject: debug wrong start values for input fields

---
 .../nodes/PhysicsBox/PhysicsSimulationWeight.tsx   | 45 +++++++++++-----------
 1 file changed, 23 insertions(+), 22 deletions(-)

(limited to 'src/client/views/nodes/PhysicsBox/PhysicsSimulationWeight.tsx')

diff --git a/src/client/views/nodes/PhysicsBox/PhysicsSimulationWeight.tsx b/src/client/views/nodes/PhysicsBox/PhysicsSimulationWeight.tsx
index 30c78cd94..a571f03f7 100644
--- a/src/client/views/nodes/PhysicsBox/PhysicsSimulationWeight.tsx
+++ b/src/client/views/nodes/PhysicsBox/PhysicsSimulationWeight.tsx
@@ -1130,9 +1130,10 @@ export default class Weight extends React.Component<IWeightProps, IState> {
           </svg>
         </div>
       )}
+      
       {this.props.dataDoc['simulationType'] == "Pulley" && (
         <div
-          className="wheel"
+          className="rod"
           style={{
             pointerEvents: "none",
             position: "absolute",
@@ -1141,18 +1142,20 @@ export default class Weight extends React.Component<IWeightProps, IState> {
           }}
         >
           <svg width={this.props.xMax + "px"} height={this.props.layoutDoc._height + "px"}>
-            <circle
-              cx={(this.props.xMax + this.props.xMin) / 2}
-              cy={this.props.radius}
-              r={this.props.radius * 1.5}
-              fill={"#808080"}
+            <line
+              x1={this.state.xPosition + this.props.radius}
+              y1={this.state.yPosition + this.props.radius}
+              x2={this.state.xPosition + this.props.radius}
+              y2={this.props.yMin}
+              stroke={"#deb887"}
+              strokeWidth="10"
             />
           </svg>
         </div>
       )}
       {this.props.dataDoc['simulationType'] == "Pulley" && (
         <div
-          className="rod"
+          className="wheel"
           style={{
             pointerEvents: "none",
             position: "absolute",
@@ -1161,13 +1164,11 @@ export default class Weight extends React.Component<IWeightProps, IState> {
           }}
         >
           <svg width={this.props.xMax + "px"} height={this.props.layoutDoc._height + "px"}>
-            <line
-              x1={this.state.xPosition + this.props.radius}
-              y1={this.state.yPosition + this.props.radius}
-              x2={this.state.xPosition + this.props.radius}
-              y2={this.props.yMin}
-              stroke={"#deb887"}
-              strokeWidth="10"
+            <circle
+              cx={(this.props.xMax + this.props.xMin) / 2}
+              cy={this.props.radius}
+              r={this.props.radius * 1.5}
+              fill={"#808080"}
             />
           </svg>
         </div>
@@ -1369,8 +1370,8 @@ export default class Weight extends React.Component<IWeightProps, IState> {
               <line
                 x1={this.state.xPosition + this.props.radius}
                 y1={this.state.yPosition + this.props.radius}
-                x2={this.state.xPosition + this.props.radius + this.getNewAccelerationX(this.props.updatedForces) * 7}
-                y2={this.state.yPosition + this.props.radius + this.getNewAccelerationY(this.props.updatedForces) * 7}
+                x2={this.state.xPosition + this.props.radius + this.getNewAccelerationX(this.props.updatedForces) * 15}
+                y2={this.state.yPosition + this.props.radius + this.getNewAccelerationY(this.props.updatedForces) * 15}
                 stroke={"green"}
                 strokeWidth="5"
                 markerEnd="url(#accArrow)"
@@ -1380,8 +1381,8 @@ export default class Weight extends React.Component<IWeightProps, IState> {
               style={{
                 pointerEvents: "none",
                 position: "absolute",
-                left: this.state.xPosition + this.props.radius + this.state.xAccel * 3 + 25 + "px",
-                top: this.state.yPosition + this.props.radius + this.state.yAccel * 3 + 70 + "px",
+                left: this.state.xPosition + this.props.radius + this.state.xAccel * 15 + 25 + "px",
+                top: this.state.yPosition + this.props.radius + this.state.yAccel * 15 + 70 + "px",
                 lineHeight: 1,
               }}
             >
@@ -1423,8 +1424,8 @@ export default class Weight extends React.Component<IWeightProps, IState> {
               <line
                 x1={this.state.xPosition + this.props.radius}
                 y1={this.state.yPosition + this.props.radius}
-                x2={this.state.xPosition + this.props.radius + this.state.xVelocity * 3}
-                y2={this.state.yPosition + this.props.radius + this.state.yVelocity * 3}
+                x2={this.state.xPosition + this.props.radius + this.state.xVelocity * 7}
+                y2={this.state.yPosition + this.props.radius + this.state.yVelocity * 7}
                 stroke={"blue"}
                 strokeWidth="5"
                 markerEnd="url(#velArrow)"
@@ -1434,8 +1435,8 @@ export default class Weight extends React.Component<IWeightProps, IState> {
               style={{
                 pointerEvents: "none",
                 position: "absolute",
-                left: this.state.xPosition + this.props.radius + this.state.xVelocity * 3 + 25 + "px",
-                top: this.state.yPosition +  this.props.radius + this.state.yVelocity * 3 + "px",
+                left: this.state.xPosition + this.props.radius + this.state.xVelocity * 7 + 25 + "px",
+                top: this.state.yPosition +  this.props.radius + this.state.yVelocity * 7 + "px",
                 lineHeight: 1,
               }}
             >
-- 
cgit v1.2.3-70-g09d2

