diff options
author | brynnchernosky <56202540+brynnchernosky@users.noreply.github.com> | 2023-05-01 19:38:04 -0400 |
---|---|---|
committer | brynnchernosky <56202540+brynnchernosky@users.noreply.github.com> | 2023-05-01 19:38:04 -0400 |
commit | 2845498ef0aa41b7a21866062b3d6583d760879e (patch) | |
tree | 3197df24567f901f357d2798064ab8c0a1aed008 | |
parent | 9af9cd8ad4e12d348f559fc633ba96f0cfb2dc5d (diff) |
debugging
-rw-r--r-- | src/client/views/nodes/PhysicsBox/PhysicsSimulationInputField.tsx | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/client/views/nodes/PhysicsBox/PhysicsSimulationInputField.tsx b/src/client/views/nodes/PhysicsBox/PhysicsSimulationInputField.tsx index 75bc28919..f3491fbd6 100644 --- a/src/client/views/nodes/PhysicsBox/PhysicsSimulationInputField.tsx +++ b/src/client/views/nodes/PhysicsBox/PhysicsSimulationInputField.tsx @@ -25,6 +25,8 @@ export interface IInputProps { interface IState { tempValue: number, tempRadianValue: number, + width: string; + margin: string; } export default class InputField extends React.Component<IInputProps, , IState> { @@ -32,17 +34,16 @@ export default class InputField extends React.Component<IInputProps, , IState> { super(props) this.state = { tempValue: this.props.mode != "Freeform" && !this.props.showIcon ? 0 : this.props.value, - tempRadianValue: this.props.mode != "Freeform" && !this.props.showIcon ? 0 : (Number(this.props.value) * Math.PI) / 180 + tempRadianValue: this.props.mode != "Freeform" && !this.props.showIcon ? 0 : (Number(this.props.value) * Math.PI) / 180, + width: this.props.small ? "6em" : "7em", + margin: this.props.small ? "0px" : "10px" + } } epsilon: number = 0; - width: string = "6em"; - margin: string = "6em"; componentDidMount() { this.epsilon = 0.01; - this.width = this.props.small ? "6em" : "7em"; - this.margin = this.props.small ? "0px" : "10px"; } componentDidUpdate(prevProps: Readonly<IInputProps>, prevState: Readonly<IState>, snapshot?: any): void { @@ -120,8 +121,8 @@ export default class InputField extends React.Component<IInputProps, , IState> { onChange={this.onChange} sx={{ height: "1em", - width: { this.width }, - marginLeft: { this.margin }, + width: this.state.width, + marginLeft: this.state.margin, zIndex: "modal", }} inputProps={{ @@ -157,8 +158,8 @@ export default class InputField extends React.Component<IInputProps, , IState> { onChange={this.onChangeRadianValue} sx={{ height: "1em", - width: { this.width }, - marginLeft: { this.margin }, + width: this.state.width, + marginLeft: this.state.margin, zIndex: "modal", }} inputProps={{ |