Author: spouliot
Date: 2007-11-01 08:04:35 -0500 (Thu, 01 Nov 2007)
New Revision: 88640

Modified:
   trunk/libgdiplus/src/ChangeLog
   trunk/libgdiplus/src/pen.c
Log:
pen.c: Fix pen scaling (either X or Y) by 0. MS GDI+ produce a thin line while 
Cairo would return an error. Fix bug #338233

Modified: trunk/libgdiplus/src/ChangeLog
===================================================================
--- trunk/libgdiplus/src/ChangeLog      2007-11-01 12:27:03 UTC (rev 88639)
+++ trunk/libgdiplus/src/ChangeLog      2007-11-01 13:04:35 UTC (rev 88640)
@@ -1,7 +1,9 @@
-2007-11-01  Sebastien Pouliot  <[EMAIL PROTECTED]>
+2007-11-01  Sebastien Pouliot  <[EMAIL PROTECTED]> 
 
        * font.c: Fix font face selection (typo) and ensure the font-family
        doesn't cache a version without bold and/or italics. Fix #338207
+       * pen.c: Fix pen scaling (either X or Y) by 0. MS GDI+ produce a thin
+       line while Cairo would return an error. Fix bug #338233
 
 2007-10-31  Sebastien Pouliot  <[EMAIL PROTECTED]> 
 

Modified: trunk/libgdiplus/src/pen.c
===================================================================
--- trunk/libgdiplus/src/pen.c  2007-11-01 12:27:03 UTC (rev 88639)
+++ trunk/libgdiplus/src/pen.c  2007-11-01 13:04:35 UTC (rev 88640)
@@ -156,6 +156,11 @@
         * reset to its own state after stroking.
         */
        cairo_matrix_multiply (&product, &pen->matrix, graphics->copy_of_ctm);
+       /* Pen scaling by 0 are supported by MS GDI+ but would error in Cairo, 
see bug #338233 */
+       if (gdip_near_zero (product.xx) || gdip_near_zero (product.yy)) {
+               /* *both* X and Y are affected if either is 0 */
+               product.xx = product.yy = 0.0001f;
+       }
        cairo_set_matrix (graphics->ct, &product);
 
        /* Don't need to setup, if pen is the same as the cached pen and

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

Reply via email to