2005-11-15 Ben Maurer <bmaurer@ximian.com>

* gdk/Rectangle.custom: Fix up Intersect using p/invoke, per
	miguel's request.


svn path=/trunk/gtk-sharp/; revision=53095
This commit is contained in:
Ben Maurer 2005-11-15 23:42:05 +00:00
parent a69dd0414d
commit 75af9256fb
2 changed files with 10 additions and 13 deletions

View file

@ -1,3 +1,8 @@
2005-11-15 Ben Maurer <bmaurer@ximian.com>
* gdk/Rectangle.custom: Fix up Intersect using p/invoke, per
miguel's request.
2005-11-10 Mike Kestner <mkestner@novell.com>
* bootstrap-2.6 - renamed from bootstrap

View file

@ -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;
}