aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/views/nodes/PhysicsBox/PhysicsSimulationBox.tsx10
-rw-r--r--src/client/views/nodes/PhysicsBox/PhysicsSimulationWeight.tsx6
2 files changed, 8 insertions, 8 deletions
diff --git a/src/client/views/nodes/PhysicsBox/PhysicsSimulationBox.tsx b/src/client/views/nodes/PhysicsBox/PhysicsSimulationBox.tsx
index cf873da1d..db187d1b8 100644
--- a/src/client/views/nodes/PhysicsBox/PhysicsSimulationBox.tsx
+++ b/src/client/views/nodes/PhysicsBox/PhysicsSimulationBox.tsx
@@ -512,7 +512,7 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent<Fi
}
- this.dataDoc.startPosX = this.xMax*0.25-(0.08*this.layoutDoc._height);
+ this.dataDoc.startPosX = this.xMax*0.25;
this.dataDoc.startPosY = yPos;
if (this.dataDoc.mode == "Freeform") {
this.updateForcesWithFriction(
@@ -1149,9 +1149,9 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent<Fi
setupPulley = () => {
this.dataDoc.showComponentForces = (false);
this.dataDoc.startPosY = ((this.yMax + this.yMin) / 2);
- this.dataDoc.startPosX = ((this.xMin + this.xMax) / 2 - 105);
+ this.dataDoc.startPosX = ((this.xMin + this.xMax) / 2 - 2*(0.08*this.layoutDoc._height)-5);
this.dataDoc.positionYDisplay = (this.getDisplayYPos((this.yMax + this.yMin) / 2));
- this.dataDoc.positionXDisplay = ((this.xMin + this.xMax) / 2 - 105);
+ this.dataDoc.positionXDisplay = ((this.xMin + this.xMax) / 2 - 2*(0.08*this.layoutDoc._height)-5);
let a = (-1 * ((this.dataDoc.mass - this.dataDoc.mass2) * Math.abs(this.dataDoc.gravity))) / (this.dataDoc.mass + this.dataDoc.mass2);
const gravityForce1: IForce = {
description: "Gravity",
@@ -1182,9 +1182,9 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent<Fi
this.dataDoc.updatedForces = ([gravityForce1, tensionForce1]);
this.dataDoc.startForces = ([gravityForce1, tensionForce1]);
this.dataDoc.startPosY2 = ((this.yMax + this.yMin) / 2);
- this.dataDoc.startPosX2 = ((this.xMin + this.xMax) / 2 + 5);
+ this.dataDoc.startPosX2 = ((this.xMin + this.xMax) / 2 + 5 + (0.08*this.layoutDoc._height));
this.dataDoc.positionYDisplay2 = (this.getDisplayYPos((this.yMax + this.yMin) / 2));
- this.dataDoc.positionXDisplay2 = ((this.xMin + this.xMax) / 2 + 5);
+ this.dataDoc.positionXDisplay2 = ((this.xMin + this.xMax) / 2 + 5 + (0.08*this.layoutDoc._height));
this.dataDoc.updatedForces2 = ([gravityForce2, tensionForce2]);
this.dataDoc.startForces2 = ([gravityForce2, tensionForce2]);
diff --git a/src/client/views/nodes/PhysicsBox/PhysicsSimulationWeight.tsx b/src/client/views/nodes/PhysicsBox/PhysicsSimulationWeight.tsx
index 27f57070e..4e7d0e7e6 100644
--- a/src/client/views/nodes/PhysicsBox/PhysicsSimulationWeight.tsx
+++ b/src/client/views/nodes/PhysicsBox/PhysicsSimulationWeight.tsx
@@ -132,9 +132,9 @@ export default class Weight extends React.Component<IWeightProps, IState> {
display: "flex",
height: 2 * this.props.radius + "px",
justifyContent: "center",
- left: this.props.dataDoc['startPosX'] + "px",
+ left: this.props.startPosX + "px",
position: "absolute" as "absolute",
- top: this.props.dataDoc['startPosY'] + "px",
+ top: this.props.startPosY + "px",
touchAction: "none",
width: 2 * this.props.radius + "px",
zIndex: 5,
@@ -436,7 +436,7 @@ export default class Weight extends React.Component<IWeightProps, IState> {
// Update wedge coordinates
if (prevProps.wedgeWidth != this.props.wedgeWidth || prevProps.wedgeHeight != this.props.wedgeHeight) {
- const left = this.props.xMax * 0.5 - 200;
+ const left = this.props.xMax * 0.25;
const coordinatePair1 = Math.round(left) + "," + this.props.yMax + " ";
const coordinatePair2 = Math.round(left + this.props.wedgeWidth) + "," + this.props.yMax + " ";
const coordinatePair3 = Math.round(left) + "," + (this.props.yMax - this.props.wedgeHeight);