I've been busy with school and also with preparing for the upcoming
[mono.git] / mcs / class / System.Drawing / System.Drawing.Drawing2D / Matrix.cs
index dfd28afc0db0c4b69093f9d36bb5080c1617c8c6..0721def01246038057e50220d42d5d0c9918a792 100644 (file)
@@ -15,7 +15,7 @@ using System.Runtime.InteropServices;
 \r
 namespace System.Drawing.Drawing2D\r
 {\r
-        public  sealed class Matrix : MarshalByRefObject, IDisposable\r
+        public sealed class Matrix : MarshalByRefObject, IDisposable\r
         {\r
                 internal IntPtr nativeMatrix;\r
                 \r
@@ -32,16 +32,12 @@ namespace System.Drawing.Drawing2D
         \r
                 public Matrix (Rectangle rect , Point[] plgpts)\r
                 {\r
-                        GpRect rectangle = new GpRect (rect);\r
-\r
-                        GDIPlus.GdipCreateMatrix3I (rectangle, plgpts, out nativeMatrix);\r
+                        GDIPlus.GdipCreateMatrix3I (rect, plgpts, out nativeMatrix);\r
                 }\r
         \r
                 public Matrix (RectangleF rect , PointF[] pa)\r
                 {\r
-                        GpRectF rectangle = new GpRectF (rect);\r
-\r
-                        GDIPlus.GdipCreateMatrix3 (rectangle, pa, out nativeMatrix);\r
+                        GDIPlus.GdipCreateMatrix3 (rect, pa, out nativeMatrix);\r
                 }\r
 \r
                 public Matrix (float m11, float m12, float m21, float m22, float dx, float dy)\r
@@ -52,12 +48,11 @@ namespace System.Drawing.Drawing2D
                 // properties\r
                 public float[] Elements {\r
                         get {\r
-                                IntPtr tmp = Marshal.AllocHGlobal (8 * 6);\r
+                                IntPtr tmp = Marshal.AllocHGlobal (Marshal.SizeOf (typeof (float)) * 6);\r
+                                float [] retval = new float [6];\r
 \r
                                 Status s = GDIPlus.GdipGetMatrixElements (nativeMatrix, tmp);\r
 \r
-                                float [] retval = new float [6];\r
-\r
                                 Marshal.Copy (tmp, retval, 0, 6);\r
 \r
                                 Marshal.FreeHGlobal (tmp);\r