aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/PhysicsSimulationWedge.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/nodes/PhysicsSimulationWedge.tsx')
-rw-r--r--src/client/views/nodes/PhysicsSimulationWedge.tsx15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/client/views/nodes/PhysicsSimulationWedge.tsx b/src/client/views/nodes/PhysicsSimulationWedge.tsx
index bf0cadce2..b3988221c 100644
--- a/src/client/views/nodes/PhysicsSimulationWedge.tsx
+++ b/src/client/views/nodes/PhysicsSimulationWedge.tsx
@@ -1,5 +1,4 @@
-import React from "react";
-import { useState, useEffect, useCallback } from "react";
+import React = require('react');
import "./PhysicsSimulationBox.scss";
export interface IWedgeProps {
@@ -29,16 +28,16 @@ export default class Wedge extends React.Component<IWedgeProps, IState> {
updateCoordinates() {
const coordinatePair1 =
- Math.round(this.state.left) + "," + Math.round(window.innerHeight * 0.8) + " ";
+ Math.round(this.state.left) + "," + Math.round(300 * 0.8) + " ";
const coordinatePair2 =
Math.round(this.state.left + this.props.startWidth) +
"," +
- Math.round(window.innerHeight * 0.8) +
+ Math.round(300 * 0.8) +
" ";
const coordinatePair3 =
Math.round(this.state.left) +
"," +
- Math.round(window.innerHeight * 0.8 - this.props.startHeight);
+ Math.round(300 * 0.8 - this.props.startHeight);
const coord = coordinatePair1 + coordinatePair2 + coordinatePair3;
this.setState({coordinates: coord});
}
@@ -59,8 +58,8 @@ export default class Wedge extends React.Component<IWedgeProps, IState> {
<div>
<div style={{ position: "absolute", left: "0", top: "0", zIndex: -5 }}>
<svg
- width={window.innerWidth * 0.7 + "px"}
- height={window.innerHeight * 0.8 + "px"}
+ width={300 * 0.7 + "px"}
+ height={300 * 0.8 + "px"}
>
<polygon points={this.state.coordinates} style={{ fill: "burlywood" }} />
</svg>
@@ -71,7 +70,7 @@ export default class Wedge extends React.Component<IWedgeProps, IState> {
position: "absolute",
zIndex: 500,
left: Math.round(this.state.left + this.props.startWidth - 80) + "px",
- top: Math.round(window.innerHeight * 0.8 - 40) + "px",
+ top: Math.round(300 * 0.8 - 40) + "px",
}}
>
{Math.round(((this.state.angleInRadians * 180) / Math.PI) * 100) / 100}°