2006-05-11 Chris Toshok <toshok@ximian.com>
authorChris Toshok <toshok@novell.com>
Thu, 11 May 2006 20:01:30 +0000 (20:01 -0000)
committerChris Toshok <toshok@novell.com>
Thu, 11 May 2006 20:01:30 +0000 (20:01 -0000)
* Hwnd.cs (Invalid): don't start off with Rectangle.Empty, as
union of that will always be {0,0,width,height}.

svn path=/trunk/mcs/; revision=60604

mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
mcs/class/Managed.Windows.Forms/System.Windows.Forms/Hwnd.cs

index dba9814c67e850a870b68c86120e5863124e9430..e116a0920099d8f00e6f9b8d42f38de5b03ede69 100644 (file)
@@ -1,3 +1,8 @@
+2006-05-11  Chris Toshok  <toshok@ximian.com>
+
+       * Hwnd.cs (Invalid): don't start off with Rectangle.Empty, as
+       union of that will always be {0,0,width,height}.
+
 2006-05-11  Jackson Harper  <jackson@ximian.com>
 
        * Form.cs: Match MS's DefaultSize for forms (they must have
index f56f868a00a29c89e8a1d1a183637a83083030bd..1413109e2d5249bc0bf218cd2bff2e97b495a123 100644 (file)
@@ -399,16 +399,11 @@ namespace System.Windows.Forms {
 
                public Rectangle Invalid {
                        get {
-                               if (invalid_list.Count == 1) {
-                                       return (Rectangle) invalid_list [0];
-                               }
-
-                               Rectangle result = Rectangle.Empty;
-                               foreach (Rectangle r in invalid_list) {
-                                       result = Rectangle.Union (result, r);
+                               Rectangle result = (Rectangle)invalid_list[0];
+                               for (int i = 1; i < invalid_list.Count; i ++) {
+                                       result = Rectangle.Union (result, (Rectangle)invalid_list[i]);
                                }
                                return result;
-
                        }
                }