Skip to content

Commit

Permalink
Use ternary operator, see #398
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Mar 2, 2023
1 parent 65d559e commit 65ddcd2
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions js/quadrilateral/model/QuadrilateralModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,19 +126,9 @@ class QuadrilateralModel implements TModel {
this.vertexIntervalProperty = new DerivedProperty(
[ this.useMinorIntervalsProperty, this.tangibleConnectionModel.connectedToDeviceProperty, optionsModel.tangibleOptionsModel.deviceGridSpacingProperty ],
( useMinorIntervals, connectedToDevice, deviceGridSpacing ) => {

let interval: number;
if ( connectedToDevice ) {
interval = deviceGridSpacing;
}
else if ( QuadrilateralQueryParameters.reducedStepSize ) {
interval = useMinorIntervals ? QuadrilateralConstants.MINOR_REDUCED_SIZE_VERTEX_INTERVAL : QuadrilateralConstants.MAJOR_REDUCED_SIZE_VERTEX_INTERVAL;
}
else {
interval = useMinorIntervals ? QuadrilateralQueryParameters.minorVertexInterval : QuadrilateralQueryParameters.majorVertexInterval;
}

return interval;
return connectedToDevice ? deviceGridSpacing :
QuadrilateralQueryParameters.reducedStepSize ? ( useMinorIntervals ? QuadrilateralConstants.MINOR_REDUCED_SIZE_VERTEX_INTERVAL : QuadrilateralConstants.MAJOR_REDUCED_SIZE_VERTEX_INTERVAL ) :
useMinorIntervals ? QuadrilateralQueryParameters.minorVertexInterval : QuadrilateralQueryParameters.majorVertexInterval;
}
);
}
Expand Down

0 comments on commit 65ddcd2

Please sign in to comment.