Skip to content

Commit

Permalink
Simplify code.
Browse files Browse the repository at this point in the history
  • Loading branch information
abrahamwolk committed Jul 11, 2023
1 parent 13d240d commit b868d2f
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -269,11 +269,10 @@ public static double selectNiceStep(final double min_distance)
{
final double log = Math.log10(min_distance);
final double order_of_magnitude = Math.pow(10, Math.floor(log));
final double step = min_distance / order_of_magnitude;
for (int i=0; i<NICE_STEPS.length; ++i)
if (NICE_STEPS[i] * order_of_magnitude >= min_distance)
return NICE_STEPS[i] * order_of_magnitude;
return step * order_of_magnitude;
return min_distance;
}

/** Create decimal format
Expand Down

0 comments on commit b868d2f

Please sign in to comment.