* bitmap.c:
authorDuncan Mak <duncan@mono-cvs.ximian.com>
Mon, 26 Jan 2004 15:08:33 +0000 (15:08 -0000)
committerDuncan Mak <duncan@mono-cvs.ximian.com>
Mon, 26 Jan 2004 15:08:33 +0000 (15:08 -0000)
* graphics.c: Use C style comments instead of C++ style.

* pen.c (clone_dash_array): new helper function.
(GdipClonePen): Copy matrix and dash_array, removed the FIXME.

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

mcs/class/System.Drawing/gdiplus/ChangeLog
mcs/class/System.Drawing/gdiplus/bitmap.c
mcs/class/System.Drawing/gdiplus/graphics.c
mcs/class/System.Drawing/gdiplus/pen.c

index 12510560ff768c4fa82cdcdcd3eff7341c89df79..187b90ab3829cab559628279bc94b56b16cc703b 100644 (file)
@@ -1,3 +1,11 @@
+2004-01-26  Duncan Mak  <duncan@ximian.com>
+
+       * bitmap.c:
+       * graphics.c: Use C style comments instead of C++ style.
+
+       * pen.c (clone_dash_array): new helper function.
+       (GdipClonePen): Copy matrix and dash_array, removed the FIXME.
+
 2004-01-23  Duncan Mak  <duncan@ximian.com>
 
        * graphics.c (GdipDrawPath): Implemented.
index 67855dee7a5b70b2cd11942ca25b6c1606c97aad..626f90ebb46f906b4e4a8d08228e2b1fe79627e0 100644 (file)
@@ -115,7 +115,7 @@ gdip_bitmap_create_Win32_HDC (GpBitmap *bitmap)
        if (hbitmap != 0) {
                BITMAPINFO      bmi;
                gdip_bitmap_fill_info_header (bitmap, &bmi.bmiHeader);
-               //_saveBmp ("file1.bmp", bitmap);
+               /* _saveBmp ("file1.bmp", bitmap); */
                SetDIBits_pfn (hdc, hbitmap, 0, bitmap->data.Height, bitmap->data.Scan0, &bmi, 0);
                holdbitmap = SelectObject_pfn (hdc, hbitmap);
                bitmap->hBitmapDC = hdc;
@@ -151,7 +151,7 @@ gdip_bitmap_destroy_Win32_HDC (GpBitmap *bitmap, void *hdc)
                                ++array;
                        }
                }
-               //_saveBmp ("file2.bmp", bitmap);
+               /* _saveBmp ("file2.bmp", bitmap); */
 
                DeleteObject_pfn (bitmap->hBitmap);
                DeleteDC_pfn (bitmap->hBitmapDC);
@@ -169,7 +169,7 @@ GdipCreateBitmapFromScan0 (int width, int height, int stride, int format, void *
 
        if (stride == 0)
                return InvalidParameter;
-       if (scan0 == NULL)                              //FIXME: Win32 GDIPlus accepts NULL as a value for the scan0 parameter. Jordi,
+       if (scan0 == NULL)                              /* FIXME: Win32 GDIPlus accepts NULL as a value for the scan0 parameter. Jordi, */
                return InvalidParameter;
                        
        switch (format) {
index 4339416a21a26bf5aef7b0d0691ef13c5b64ab7f..11b6239fc9e58837c0066a7ee389a08d3f221039 100644 (file)
@@ -291,7 +291,7 @@ GdipReleaseDC (GpGraphics *graphics, int hDC)
        return Ok;
 }
 
-// FIXME: the stack implementation is probably not suitable
+/* FIXME: the stack implementation is probably not suitable */
 #define MAX_GRAPHICS_STATE_STACK 100
 
 GpState saved_stack [MAX_GRAPHICS_STATE_STACK];
index 85437e72aa978b1a27c6a338660912b374c42339..9b288303140ad02982b990fbb6ea93c789435548 100644 (file)
@@ -166,11 +166,28 @@ GdipCreatePen2 (GpBrush *brush, float width, GpUnit unit, GpPen **pen)
         }
 }
 
+static float *
+clone_dash_array (float *clone, float *array, int size)
+{
+        int i;
+
+        for (i = 0; i < size; i++)
+                clone [i] = array [i];
+
+        return clone;
+}
+
 GpStatus 
 GdipClonePen (GpPen *pen, GpPen **clonepen)
 {
-       // FIXME: copy dash array and matrix
         GpPen *result = gdip_pen_new ();
+        int count = pen->dash_count;
+        GpMatrix *matrix;       /* copy of pen->matrix */
+        float dashes [count];   /* copy off pen->dash_array */
+
+        GdipCloneMatrix (pen->matrix, &matrix);
+        clone_dash_array (dashes, pen->dash_array, count);
+
         result->color = pen->color;
        result->brush = pen->brush;
         result->width = pen->width;
@@ -182,9 +199,9 @@ GdipClonePen (GpPen *pen, GpPen **clonepen)
         result->dash_offset = pen->dash_offset;
        result->dash_count = pen->dash_count;
        result->own_dash_array = 0;
-       result->dash_array = pen->dash_array;
+       result->dash_array = dashes;
        result->unit = pen->unit;
-        result->matrix = pen->matrix;
+        result->matrix = matrix;
 
         *clonepen = result;