Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,7 @@ public DistanceTarget(DistanceUnit unit, double target, double threshold, String
*/
public boolean atTarget(double currentDistance) {
currentDistance = unit.fromUnit(unit, currentDistance);
double clippedRange = Range.clip(currentDistance, currentDistance - threshold, currentDistance + threshold);
if (clippedRange >= currentDistance + threshold)
return false;
else return !(clippedRange <= currentDistance + threshold);
return (currentDistance >= target - threshold) && (currentDistance <= target + threshold);
}

/**
Expand Down