Skip to content

Commit

Permalink
Revert "Feature/807 coord invert (hajkmap#835)" (hajkmap#837)
Browse files Browse the repository at this point in the history
This reverts commit a8435e6.
  • Loading branch information
jacobwod authored Jul 1, 2021
1 parent 2ca04fb commit 7a206ab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 21 deletions.
26 changes: 6 additions & 20 deletions new-client/src/plugins/Coordinates/CoordinatesTransformRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,7 @@ class CoordinatesTransformRow extends React.PureComponent {
}

handleInputX(event) {
if (
(!this.props.inverseAxis && event.value === this.state.coordinateX) ||
(this.props.inverseAxis && event.value === this.state.coordinateY)
) {
if (event.value === this.state.coordinateX) {
// Nothing was changed so do nothing, this happens since the value is
// changed multiple times during formatting and we do not want to create
// infinite loops
Expand Down Expand Up @@ -122,10 +119,7 @@ class CoordinatesTransformRow extends React.PureComponent {
}

handleInputY(event) {
if (
(!this.props.inverseAxis && event.value === this.state.coordinateY) ||
(this.props.inverseAxis && event.value === this.state.coordinateX)
) {
if (event.value === this.state.coordinateY) {
// Nothing was changed so do nothing, this happens since the value is
// changed multiple times during formatting and we do not want to create
// infinite loops
Expand Down Expand Up @@ -177,11 +171,7 @@ class CoordinatesTransformRow extends React.PureComponent {
</TableCell>
<TableCell>
<NumberFormat
label={
this.props.inverseAxis
? this.props.transformation.ytitle
: this.props.transformation.xtitle
}
label={this.props.transformation.ytitle}
className={classes.textField}
margin="dense"
variant="outlined"
Expand All @@ -191,18 +181,14 @@ class CoordinatesTransformRow extends React.PureComponent {
onValueChange={(values) => {
this.handleInputX(values);
}}
axis={this.props.inverseAxis ? "X" : "Y"}
axis={this.props.transformation.inverseAxis ? "X" : "Y"}
error={this.state.errorX !== ""}
helperText={this.state.errorX}
thousandSeparator={this.model.thousandSeparator ? " " : false}
customInput={TextField}
/>
<NumberFormat
label={
this.props.inverseAxis
? this.props.transformation.xtitle
: this.props.transformation.ytitle
}
label={this.props.transformation.xtitle}
className={classes.textField}
margin="dense"
variant="outlined"
Expand All @@ -212,7 +198,7 @@ class CoordinatesTransformRow extends React.PureComponent {
onValueChange={(values) => {
this.handleInputY(values);
}}
axis={this.props.inverseAxis ? "Y" : "X"}
axis={this.props.transformation.inverseAxis ? "Y" : "X"}
error={this.state.errorY !== ""}
helperText={this.state.errorY}
thousandSeparator={this.model.thousandSeparator ? " " : false}
Expand Down
1 change: 0 additions & 1 deletion new-client/src/plugins/Coordinates/CoordinatesView.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ class CoordinatesView extends React.PureComponent {
key={transformation.code + index + "-element"}
model={this.model}
transformation={transformation}
inverseAxis={transformation.inverseAxis}
/>
);
})}
Expand Down

0 comments on commit 7a206ab

Please sign in to comment.