svn path=/trunk/mcs/; revision=114953
+2008-10-06 Sebastien Pouliot <sebastien@ximian.com>
+
+ * RectangleF.cs: Fix edge intersection. Path by Brian Browning.
+ [Fix bug #431587]
+
2008-08-08 Gert Driesen <drieseng@users.sourceforge.net>
* Icon.cs (InitFromStreamWithSize): Use temp ArrayList for IconDirEntry
public static RectangleF Intersect (RectangleF a,
RectangleF b)
{
- if (!a.IntersectsWith (b))
+ // MS.NET returns a non-empty rectangle if the two rectangles
+ // touch each other
+ if (!a.IntersectsWithInclusive (b))
return Empty;
return FromLTRB (
(Top >= rect.Bottom) || (Bottom <= rect.Top));
}
+ private bool IntersectsWithInclusive (RectangleF r)
+ {
+ return !((Left > r.Right) || (Right < r.Left) ||
+ (Top > r.Bottom) || (Bottom < r.Top));
+ }
+
/// <summary>
/// Offset Method
/// </summary>