Explorar o código

(AddPie): Corrected arguments sent to P/Invoke. This fixes the strange
NaNs we were getting when we tried to draw Paths with a Pie figure.

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

Duncan Mak %!s(int64=22) %!d(string=hai) anos
pai
achega
b84ccfd050

+ 6 - 0
mcs/class/System.Drawing/System.Drawing.Drawing2D/ChangeLog

@@ -1,3 +1,9 @@
+2004-01-30  Duncan Mak  <[email protected]>
+
+	* GraphicsPath.cs (AddPie): Corrected arguments sent to
+	P/Invoke. This fixes the strange NaNs we were getting when we
+	tried to draw Paths with a Pie figure.
+
 2004-01-24  Duncan Mak  <[email protected]>
 
 	* GraphicsPath.cs (AddEllipse): Added.

+ 2 - 2
mcs/class/System.Drawing/System.Drawing.Drawing2D/GraphicsPath.cs

@@ -270,12 +270,12 @@ namespace System.Drawing.Drawing2D
 
                 public void AddPie (int x, int y, int width, int height, float startAngle, float sweepAngle)
                 {
-                        GDIPlus.GdipAddPathPie (nativePath, x, y, width, height, sweepAngle, sweepAngle);
+                        GDIPlus.GdipAddPathPie (nativePath, x, y, width, height, startAngle, sweepAngle);
                 }
 
                 public void AddPie (float x, float y, float width, float height, float startAngle, float sweepAngle)
                 {
-                        GDIPlus.GdipAddPathPie (nativePath, x, y, width, height, sweepAngle, sweepAngle);                
+                        GDIPlus.GdipAddPathPie (nativePath, x, y, width, height, startAngle, sweepAngle);                
                 }
 
                 //

+ 1 - 2
mcs/class/System.Drawing/gdiplus/bitmap.c

@@ -185,7 +185,7 @@ GdipCreateBitmapFromScan0 (int width, int height, int stride, int format, void *
 	}
 
 	if (scan0 == NULL) {
-                scan0 = GdipAlloc (stride*height);
+                scan0 = GdipAlloc (stride * height);
                 own_scan0 = TRUE;
         }
 
@@ -197,7 +197,6 @@ GdipCreateBitmapFromScan0 (int width, int height, int stride, int format, void *
 	result->data.PixelFormat = format;
 	result->data.Scan0 = scan0;
         result->data.own_scan0 = own_scan0;
-
 		
 	*bitmap = result;
 	return Ok;