Author: everaldo
Date: 2007-01-02 01:58:06 -0500 (Tue, 02 Jan 2007)
New Revision: 70335

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs
Log:
        * ThemeWin32Classic.cs: Use float numbers to calculate size and
        position of menu arrows, it fix wrong arrow size.

2007-01-01  Everaldo Canuto  <[EMAIL PROTECTED]>



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-01-02 03:45:01 UTC (rev 70334)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-01-02 06:58:06 UTC (rev 70335)
@@ -1,5 +1,10 @@
 2007-01-01  Everaldo Canuto  <[EMAIL PROTECTED]>
 
+       * ThemeWin32Classic.cs: Use float numbers to calculate size and
+       position of menu arrows, it fix wrong arrow size.
+
+2007-01-01  Everaldo Canuto  <[EMAIL PROTECTED]>
+
        * ThemeWin32Classic.cs: Uses CPDrawBorder3D to draw menu borders
        instead of line, it simplify draw operation and fix it using 3D
        borders to mimic Win32.

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs
===================================================================
--- 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs 
    2007-01-02 03:45:01 UTC (rev 70334)
+++ 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs 
    2007-01-02 06:58:06 UTC (rev 70335)
@@ -5512,32 +5512,21 @@
 
                        switch(glyph) {
                        case MenuGlyph.Arrow: {
-                               Point[]                 arrow = new Point[3];
-                               Point                           P1;
-                               Point                           P2;
-                               Point                           P3;
-                               int                             centerX;
-                               int                             centerY;
-                               int                             shiftX;
+                               float height = rectangle.Height * 0.7f;
+                               float width  = height / 2.0f;
+                               
+                               PointF ddCenter = new PointF (rectangle.X + 
((rectangle.Width-width) / 2.0f), rectangle.Y + (rectangle.Height / 2.0f));
 
-                               rect=new 
Rectangle(rectangle.X+rectangle.Width/4, rectangle.Y+rectangle.Height/4, 
rectangle.Width/2, rectangle.Height/2);
-                               centerX=rect.Left+rect.Width/2;
-                               centerY=rect.Top+rect.Height/2;
-                               shiftX=Math.Max(1, rect.Width/8);
+                               PointF [] vertices = new PointF [3];
+                               vertices [0].X = ddCenter.X;
+                               vertices [0].Y = ddCenter.Y - (height / 2.0f);
+                               vertices [1].X = ddCenter.X;
+                               vertices [1].Y = ddCenter.Y + (height / 2.0f);
+                               vertices [2].X = ddCenter.X + width + 0.1f;
+                               vertices [2].Y = ddCenter.Y;
+                               
+                               graphics.FillPolygon (brush, vertices);
 
-                               rect.X-=shiftX;
-                               centerX-=shiftX;
-
-                               P1=new Point(centerX, rect.Top);
-                               P2=new Point(centerX, rect.Bottom);
-                               P3=new Point(rect.Right, centerY);
-
-                               arrow[0]=P1;
-                               arrow[1]=P2;
-                               arrow[2]=P3;
-
-                               graphics.FillPolygon(brush, arrow, 
FillMode.Winding);
-
                                return;
                        }
 

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to