Bugfix in edge detection during 2D ray tracing

The problem manifested itself in potential bogus hit
point locations as part of TRIGGER output.