From 550d2d4b02bbaa19d6ca1b7f4d6146f4ed171bab Mon Sep 17 00:00:00 2001 From: brynnchernosky <56202540+brynnchernosky@users.noreply.github.com> Date: Thu, 4 May 2023 11:36:18 -0400 Subject: pulley debugging --- src/client/views/nodes/PhysicsBox/PhysicsSimulationBox.tsx | 10 +++++----- src/client/views/nodes/PhysicsBox/PhysicsSimulationWeight.tsx | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src') 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 { 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 { 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 { // 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); -- cgit v1.2.3-70-g09d2