A candidate closer to the cursor than the best so far (or as close, and nearer).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | pixels |
the candidate's distance from the cursor (pixels) |
||
| real(kind=wp), | intent(in) | :: | depth |
its depth |
||
| real(kind=wp), | intent(in) | :: | best_pixels |
the best hit's so far (pixels) |
||
| real(kind=wp), | intent(in) | :: | best_depth |
the best hit's depth |
pure logical function better(pixels, depth, best_pixels, best_depth) real(wp), intent(in) :: pixels !! the candidate's distance from the cursor (pixels) real(wp), intent(in) :: depth !! its depth real(wp), intent(in) :: best_pixels !! the best hit's so far (pixels) real(wp), intent(in) :: best_depth !! the best hit's depth better = pixels < best_pixels - 0.5_wp .or. (pixels <= best_pixels + 0.5_wp .and. depth < best_depth) end function better