aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/PhysicsBox/PhysicsSimulationBox.tsx
diff options
context:
space:
mode:
authorbrynnchernosky <56202540+brynnchernosky@users.noreply.github.com>2023-05-02 15:27:42 -0400
committerbrynnchernosky <56202540+brynnchernosky@users.noreply.github.com>2023-05-02 15:27:42 -0400
commitf363260bd8857834176fb5bba215fe5218ec8d87 (patch)
treef5912f4fad0a47a31beeae2e36cfcc69d4bcf747 /src/client/views/nodes/PhysicsBox/PhysicsSimulationBox.tsx
parent1e99c215456af073a7aade297d19f4dd4a9ecf8c (diff)
debugging
Diffstat (limited to 'src/client/views/nodes/PhysicsBox/PhysicsSimulationBox.tsx')
-rw-r--r--src/client/views/nodes/PhysicsBox/PhysicsSimulationBox.tsx26
1 files changed, 17 insertions, 9 deletions
diff --git a/src/client/views/nodes/PhysicsBox/PhysicsSimulationBox.tsx b/src/client/views/nodes/PhysicsBox/PhysicsSimulationBox.tsx
index 21cef297a..691f1145c 100644
--- a/src/client/views/nodes/PhysicsBox/PhysicsSimulationBox.tsx
+++ b/src/client/views/nodes/PhysicsBox/PhysicsSimulationBox.tsx
@@ -113,9 +113,11 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent<Fi
this.wallPositions.push({ length: 80, xPos: 69.5, yPos: 0, angleInDegrees: 90 });
// Used throughout sims
- this.xMax = this.layoutDoc._width*0.08 ?? 500;
- this.yMax = this.layoutDoc._height*0.08 ?? 500;
- this.radius = 0.1*this.layoutDoc._height ?? 50;
+ this.layoutDoc._width = 1000;
+ this.layoutDoc._height = 1000;
+ this.xMax = this.layoutDoc._width*0.8 ?? 800;
+ this.yMax = this.layoutDoc._height*0.8 ?? 800;
+ this.radius = 50;
this.dataDoc.reviewCoefficient = this.dataDoc.reviewCoefficient ?? 0;
this.dataDoc.questionVariables = this.dataDoc.questionVariables ?? [];
this.dataDoc.accelerationXDisplay = this.dataDoc.accelerationXDisplay ?? 0;
@@ -363,12 +365,18 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent<Fi
// }
this.dataDoc.simulationReset = (!this.dataDoc.simulationReset);
}
+
+
+ console.log("width: ", this.xMax)
+ console.log("height: ", this.yMax)
}
componentDidUpdate() {
- this.xMax = this.layoutDoc._width*0.08 ?? 500;
- this.yMax = this.layoutDoc._height*0.08 ?? 500;
- this.radius = 0.1*this.layoutDoc._height ?? 50;
+ this.xMax = this.layoutDoc._width*0.8 ?? 800;
+ this.yMax = this.layoutDoc._height*0.8 ?? 800;
+ this.radius = 0.05*this.layoutDoc._height ?? 50;
+ console.log("width: ", this.xMax)
+ console.log("height: ", this.yMax)
}
// Helper function to go between display and real values
@@ -2453,7 +2461,7 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent<Fi
<div
style={{
position: "fixed",
- top: this.layoutDoc._height ?? 500 - 120 + 20 + "px",
+ top: this.yMax - 120 + 20 + "px",
left: this.xMin + 90 - 80 + "px",
zIndex: -10000,
}}
@@ -2494,7 +2502,7 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent<Fi
<p
style={{
position: "fixed",
- top: this.layoutDoc._height?? 500 - 120 + 40 + "px",
+ top: this.yMax - 120 + 40 + "px",
left: this.xMin + 90 - 80 + "px",
}}
>
@@ -2503,7 +2511,7 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent<Fi
<p
style={{
position: "fixed",
- top: this.layoutDoc._height ?? 500- 120 + 80 + "px",
+ top: this.yMax - 120 + 80 + "px",
left: this.xMin + 90 - 40 + "px",
}}
>