detect edges for tooltip