aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/PhysicsBox/PhysicsSimulationInputField.tsx
diff options
context:
space:
mode:
authorbrynnchernosky <56202540+brynnchernosky@users.noreply.github.com>2023-05-01 20:05:49 -0400
committerbrynnchernosky <56202540+brynnchernosky@users.noreply.github.com>2023-05-01 20:05:49 -0400
commitc93e1dc281c831ab08cf0ce29420df845323b0be (patch)
treed8c4a604f2fb2ec4bdea9b3b446a72af8a14ffd8 /src/client/views/nodes/PhysicsBox/PhysicsSimulationInputField.tsx
parentc4239e9bb5fb6389e3ceac281af8c8c683019a0c (diff)
debugging
Diffstat (limited to 'src/client/views/nodes/PhysicsBox/PhysicsSimulationInputField.tsx')
-rw-r--r--src/client/views/nodes/PhysicsBox/PhysicsSimulationInputField.tsx11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/client/views/nodes/PhysicsBox/PhysicsSimulationInputField.tsx b/src/client/views/nodes/PhysicsBox/PhysicsSimulationInputField.tsx
index 1125e6020..cd55453ea 100644
--- a/src/client/views/nodes/PhysicsBox/PhysicsSimulationInputField.tsx
+++ b/src/client/views/nodes/PhysicsBox/PhysicsSimulationInputField.tsx
@@ -23,7 +23,7 @@ export interface IInputProps {
}
interface IState {
- tempValue: number,
+ tempValue: string | number | (string|number)[],
tempRadianValue: number,
width: string;
margin: string;
@@ -71,7 +71,9 @@ export default class InputField extends React.Component<IInputProps, IState> {
} else if (value < this.props.lowerBound) {
value = this.props.lowerBound;
}
- this.props.dataDoc[this.props.prop] = value
+ if (this.props.prop != "") {
+ this.props.dataDoc[this.props.prop] = value
+ }
this.setState({tempValue: event.target.value == "" ? event.target.value : value})
this.setState({tempRadianValue: (value * Math.PI) / 180})
if (this.props.effect) {
@@ -85,8 +87,9 @@ export default class InputField extends React.Component<IInputProps, IState> {
value = 2 * Math.PI;
} else if (value < 0) {
value = 0;
+ }if (this.props.prop != "") {
+ this.props.dataDoc[this.props.prop] = (value * 180) / Math.PI
}
- this.props.dataDoc[this.props.prop] = (value * 180) / Math.PI
this.setState({tempValue: (value * 180) / Math.PI})
this.setState({tempRadianValue: value})
if (this.props.effect) {
@@ -95,6 +98,7 @@ export default class InputField extends React.Component<IInputProps, IState> {
};
render () {
+ return (
<div
style={{
display: "flex",
@@ -174,5 +178,6 @@ export default class InputField extends React.Component<IInputProps, IState> {
/>
)}
</div>
+ )
}
};