Author: spouliot
Date: 2007-10-31 19:57:11 -0500 (Wed, 31 Oct 2007)
New Revision: 88620

Modified:
   trunk/libgdiplus/src/ChangeLog
   trunk/libgdiplus/src/graphics-path.c
Log:
graphics-path.c: Avoid computing the start point coord unless we need them 
later. Add URL for formula used here.

Modified: trunk/libgdiplus/src/ChangeLog
===================================================================
--- trunk/libgdiplus/src/ChangeLog      2007-10-31 23:44:57 UTC (rev 88619)
+++ trunk/libgdiplus/src/ChangeLog      2007-11-01 00:57:11 UTC (rev 88620)
@@ -1,3 +1,8 @@
+2007-10-31  Sebastien Pouliot  <[EMAIL PROTECTED]> 
+
+       * graphics-path.c: Avoid computing the start point coord unless we
+       need them later. Add URL for formula used here.
+
 2007-10-30  Sebastien Pouliot  <[EMAIL PROTECTED]> 
 
        * lineargradientbrush.c: Remove small (+1) cosmetic fix that breaks

Modified: trunk/libgdiplus/src/graphics-path.c
===================================================================
--- trunk/libgdiplus/src/graphics-path.c        2007-10-31 23:44:57 UTC (rev 
88619)
+++ trunk/libgdiplus/src/graphics-path.c        2007-11-01 00:57:11 UTC (rev 
88620)
@@ -750,6 +750,7 @@
        }
 
        delta = beta - alpha;
+       // http://www.stillhq.com/ctpfaq/2001/comp.text.pdf-faq-2001-04.txt 
(section 2.13)
        bcp = 4.0 / 3 * (1 - cos (delta / 2)) / sin (delta / 2);
 
        sin_alpha = sin (alpha);
@@ -757,13 +758,13 @@
        cos_alpha = cos (alpha);
        cos_beta = cos (beta);
 
-        /* starting point */
-       sx = cx + rx * cos_alpha;
-       sy = cy + ry * sin_alpha;
-       
-        /* move to the starting point if we're not continuing a curve */
-        if (start)
-                append (path, sx, sy, PathPointTypeLine);
+       /* move to the starting point if we're not continuing a curve */
+       if (start) {
+               /* starting point */
+               sx = cx + rx * cos_alpha;
+               sy = cy + ry * sin_alpha;
+               append (path, sx, sy, PathPointTypeLine);
+       }
 
         append_bezier (path, 
                 cx + rx * (cos_alpha - bcp * sin_alpha),

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

Reply via email to