2006-05-01 Peter Dennis Bartok <pbartok@novell.com>
authorPeter Dennis Bartok <pbartok@mono-cvs.ximian.com>
Mon, 1 May 2006 23:21:07 +0000 (23:21 -0000)
committerPeter Dennis Bartok <pbartok@mono-cvs.ximian.com>
Mon, 1 May 2006 23:21:07 +0000 (23:21 -0000)
* ThemeWin32Classic.cs (ButtonBase_DrawImage): Use the proper image
  for determining width and height (image might not be assigned if
  we're drawing an imagelist)

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

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

index 7c3687c1f7fe844f1117d9a855f97e99b4be3c2f..4faf5339d8c36274528454791cecac5aee568f84 100644 (file)
@@ -1,3 +1,9 @@
+2006-05-01  Peter Dennis Bartok  <pbartok@novell.com>
+
+       * ThemeWin32Classic.cs (ButtonBase_DrawImage): Use the proper image
+         for determining width and height (image might not be assigned if
+         we're drawing an imagelist)
+
 2006-05-01  Peter Dennis Bartok  <pbartok@novell.com> 
 
        * XplatUI.cs, XplatUIDriver.cs: Added MenuHeight property
index be87eb98301e3dab26e9f3fda57592f7146e29d1..2f659ccfd2f91e1a60983a2c86503f7cbfa80ebd 100644 (file)
@@ -270,15 +270,15 @@ namespace System.Windows.Forms
                        
                        int width = button.ClientSize.Width;
                        int height = button.ClientSize.Height;
-                       
+
                        if (button.ImageIndex != -1) {   // We use ImageIndex instead of image_index since it will return -1 if image_list is null
                                i = button.image_list.Images[button.image_index];
                        } else {
                                i = button.image;
                        }
-                       
-                       image_width = button.image.Width;
-                       image_height = button.image.Height;
+
+                       image_width = i.Width;
+                       image_height = i.Height;
                        
                        switch (button.image_alignment) {
                                case ContentAlignment.TopLeft: {