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:
parent
a69dd0414d
commit
75af9256fb
|
@ -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>
|
2005-11-10 Mike Kestner <mkestner@novell.com>
|
||||||
|
|
||||||
* bootstrap-2.6 - renamed from bootstrap
|
* bootstrap-2.6 - renamed from bootstrap
|
||||||
|
|
|
@ -104,23 +104,15 @@ public static Rectangle Union (Rectangle r1, Rectangle r2)
|
||||||
|
|
||||||
public void Intersect (Rectangle r)
|
public void Intersect (Rectangle r)
|
||||||
{
|
{
|
||||||
if (!IntersectsWith (r)) {
|
this = Intersect (this, 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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Rectangle Intersect (Rectangle r1, Rectangle r2)
|
public static Rectangle Intersect (Rectangle r1, Rectangle r2)
|
||||||
{
|
{
|
||||||
Rectangle r = r1;
|
Rectangle r;
|
||||||
r.Intersect (r2);
|
if (!r1.Intersect (r2, out r))
|
||||||
|
return new Rectangle ();
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue