Author: spouliot
Date: 2007-03-30 09:26:03 -0500 (Fri, 30 Mar 2007)
New Revision: 75198

Modified:
   trunk/libgdiplus/src/ChangeLog
   trunk/libgdiplus/src/pen.c
Log:
pen.c: Update solid brush color (if used) when the pen color is changed. Fix 
#81266. Change GdipGetPenBrushFill to return a clone of the brush and not the 
original one.

Modified: trunk/libgdiplus/src/ChangeLog
===================================================================
--- trunk/libgdiplus/src/ChangeLog      2007-03-30 14:19:08 UTC (rev 75197)
+++ trunk/libgdiplus/src/ChangeLog      2007-03-30 14:26:03 UTC (rev 75198)
@@ -1,5 +1,8 @@
-2007-03-30  Sebastien Pouliot  <[EMAIL PROTECTED]> 
+2007-03-30  Sebastien Pouliot  <[EMAIL PROTECTED]>
 
+       * pen.c: Update solid brush color (if used) when the pen color is 
+       changed. Fix #81266. Change GdipGetPenBrushFill to return a clone of 
+       the brush and not the original one.
        * tiffcodec.c: Fix TIFFSetField as it requires at least two parameters
        (count & type) when used for TIFFTAG_EXTRASAMPLES. Fix valgrind
        warning.

Modified: trunk/libgdiplus/src/pen.c
===================================================================
--- trunk/libgdiplus/src/pen.c  2007-03-30 14:19:08 UTC (rev 75197)
+++ trunk/libgdiplus/src/pen.c  2007-03-30 14:26:03 UTC (rev 75198)
@@ -466,12 +466,10 @@
 GpStatus
 GdipGetPenBrushFill (GpPen *pen, GpBrush **brush)
 {
-       if (!pen || !brush)
+       if (!pen)
                return InvalidParameter;
 
-        *brush = pen->brush;
-
-        return Ok;
+       return GdipCloneBrush (pen->brush, brush);
 }
 
 GpStatus
@@ -495,8 +493,12 @@
                return InvalidParameter;
 
        pen->changed = pen->changed ? TRUE : (pen->color != argb);
-        pen->color = argb;
-        return Ok;
+       pen->color = argb;
+
+       if (pen->changed && pen->brush && (pen->brush->vtable->type == 
BrushTypeSolidColor))
+               return GdipSetSolidFillColor ((GpSolidFill*)pen->brush, argb);
+
+       return Ok;
 }
 
 GpStatus

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

Reply via email to