public double FindVerticalRoutingSlotRight(double left, double top, double bottom) { Rect r = new Rect(new Point(left, Math.Min(top, bottom)), new Size(10, Math.Abs(bottom - top))); var p = _horizontallySortedBounds.LowerBound(r); while (p != null && p.Data.Left < r.Right) { if (p.Data.Item.Bounds.IntersectsWith(r)) { r.X = p.Data.Right + 5; } p = p.Next; } return(r.Left); }
public double FindHorizontalRoutingSlotBottom(double top, double left, double right) { Rect r = new Rect(new Point(Math.Min(left, right), top), new Size(Math.Abs(right - left), 8)); var lower = _verticallySortedBounds.LowerBound(r); var p = lower; while (p != null && p.Data.Top < r.Bottom) { if (p.Data.Item.Bounds.IntersectsWith(r)) { r.Y = p.Data.Bottom + 20; } p = p.Next; } return(r.Top); }