diff --git a/ChangeLog b/ChangeLog index 016239295..9668b8ad5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-11-15 Ben Maurer + + * gdk/Rectangle.custom: Fix up Intersect using p/invoke, per + miguel's request. + 2005-11-10 Mike Kestner * bootstrap-2.6 - renamed from bootstrap diff --git a/gdk/Rectangle.custom b/gdk/Rectangle.custom index 955fdd23e..143d22c03 100644 --- a/gdk/Rectangle.custom +++ b/gdk/Rectangle.custom @@ -104,23 +104,15 @@ public static Rectangle Union (Rectangle r1, Rectangle r2) public void Intersect (Rectangle r) { - if (!IntersectsWith (r)) { - X = 0; - Y = 0; - Width = 0; - Height = 0; - } - - X = Math.Max (Left, r.Left); - Y = Math.Max (Top, r.Top); - Width = Math.Min (Right, r.Right) - X; - Height = Math.Min (Bottom, r.Bottom) - Y; + this = Intersect (this, r); } public static Rectangle Intersect (Rectangle r1, Rectangle r2) { - Rectangle r = r1; - r.Intersect (r2); + Rectangle r; + if (!r1.Intersect (r2, out r)) + return new Rectangle (); + return r; }