fix and speed up getOverlapInTableCoords() in presence of segments