private MatrixIntersection[] GetIntersections(MatrixInfo matrix) { List <MatrixIntersection> intersections = null; foreach (var otherMatrix in ActiveMatrices) { if (matrix == otherMatrix) { continue; } if (matrix.BoundsIntersect(otherMatrix, out Rect hotZone)) { if (intersections == null) { intersections = new List <MatrixIntersection>(); } intersections.Add(new MatrixIntersection { Matrix1 = matrix, Matrix2 = otherMatrix, Rect = hotZone }); } } if (intersections != null) { return(intersections.ToArray()); } return(noIntersections); }
private MatrixIntersection[] GetIntersections(MatrixInfo matrix) { List <MatrixIntersection> intersections = null; foreach (var otherMatrix in ActiveMatrices.Values) { if (matrix == null || matrix == otherMatrix) { continue; } if (matrix.BoundsIntersect(otherMatrix, out BetterBounds hotZone)) { if (intersections == null) { intersections = new List <MatrixIntersection>(); } intersections.Add(new MatrixIntersection(matrix, otherMatrix, hotZone)); } } if (intersections != null) { return(intersections.ToArray()); } return(noIntersections); }