better Function

private pure function better(pixels, depth, best_pixels, best_depth)

A candidate closer to the cursor than the best so far (or as close, and nearer).

Arguments

Type IntentOptional 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

Return Value logical


Called by

proc~~better~~CalledByGraph proc~better better proc~curve_pick curve_pick proc~curve_pick->proc~better proc~marker_pick marker_pick proc~marker_pick->proc~better proc~segment_artist_pick segment_artist_pick proc~segment_artist_pick->proc~better proc~drawable_pick DrawableTrajectory%drawable_pick proc~drawable_pick->proc~curve_pick proc~drawable_pick->proc~marker_pick proc~drawable_pick->proc~segment_artist_pick

Source Code

    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