Another set of fixes for bug #2811.  This time, I've added the
isVisible flag to edges to avoid processing invisible edges.
Hopefully, this really Fixes #2811

Change-Id: I40f9ac7e66f8fced1dcf6fc8f8076267956adfca